none
CE 6.0 Multiple macro definition in sources file problem RRS feed

  • Question

  • Hi,

    I have a module that is used by multiple clients but with specific behavior for each so I use the macro definition method to enable/disable part of my code.

    The problem I am having is that intellisense doesn't like one of them for some reason.  The code is compiled but it is always shown in grey in the editor.  If I am moving the definition into another enabled sysgen variable , it worked as it is supposed too...  

    Here is the extract of the sources file:

    !IF "$(SYSGEN_NWC_BUS_ENUM_2)" == "1"
    CDEFINES=$(CDEFINES) -DBSP_NWC_ASYNC_BUS_ENUM
    !ENDIF

    !IF "$(SYSGEN_ADVANTECH_MODBUS_IO_API)" == "1"
    CDEFINES=$(CDEFINES) -DBSP_ADAM_IO_API
    !ENDIF

    !IF "$(SYSGEN_PCB_VERSION_4)" == "1"
    CDEFINES=$(CDEFINES) -DBSP_PCB_VERSION_4
    !ENDIF

    !IF "$(SYSGEN_PCB_VERSION_347)" == "1"
    CDEFINES=$(CDEFINES) -DBSP_PCB_VERSION_347
    !ENDIF

    !IF "$(SYSGEN_CLIENT_A)" == "1"
    CDEFINES=$(CDEFINES) -DMMI
    !ENDIF

    !IF "$(SYSGEN_CLIENT_B)" == "1"
    CDEFINES=$(CDEFINES) -DBSP_CLIENT_B
    !ENDIF

    In my .cpp files I have a define declared like this

    #ifdef BSP_CLIENT_B

    //some code

    #endif

    and the code in between is always grey even if my sysgen_client_b is set.  If I add an error inside the #ifdef BSP_CLIENT_B  I have a compilation error which is normal.  And if I am moving -DBSP_CLIENT_B under SYSGEN_PCB_VERSION_347 everything works properly.

    Any suggestions or ideas

    Thank you


    • Edited by Keaven Tuesday, December 18, 2012 2:45 PM
    Monday, December 17, 2012 10:29 PM

Answers

  • I used 1 solution for each project/configuration.

    That way each has their individual intellisense file.

    • Marked as answer by Keaven Wednesday, May 28, 2014 3:54 PM
    Wednesday, May 28, 2014 3:54 PM

All replies

  • It seems to be caused by having several BSP projects under the same solution.   What is the recommended way to manage several BSP configuration, 1 solution for each project or 1 solution with 1 project for each configuration?

    Regards,

    Tuesday, December 18, 2012 5:35 PM
  • I used 1 solution for each project/configuration.

    That way each has their individual intellisense file.

    • Marked as answer by Keaven Wednesday, May 28, 2014 3:54 PM
    Wednesday, May 28, 2014 3:54 PM