Topic
  • 3 replies
  • Latest Post - ‏2012-05-23T14:41:47Z by buptxch
buptxch
buptxch
31 Posts

Pinned topic how can i add #ifdef ... #endif to headfilies in a SpecInclude file?

‏2012-05-23T03:17:48Z |
hi,

I came across a problem, i wanted to use a micro to add different headerfiles on different conditions. it should be like this:

in SpecIncludefile of class A:
#ifdef WIN32
#include "test_win32.h"
#endif
#ifdef VxWorks
#include "test_vxworks.h"
#endif

is there anyway to achieve this? thanks for any help.
Updated on 2012-05-23T14:41:47Z at 2012-05-23T14:41:47Z by buptxch
  • bdinesh
    bdinesh
    6 Posts

    Re: how can i add #ifdef ... #endif to headfilies in a SpecInclude file?

    ‏2012-05-23T06:59:42Z  
    SpecInclude takes only the name of files to include and so the conditional compilation cannot be enforced using this property.
    Instead, the header property CPP_CG::File::SpecificationHeader might help in getting what you wanted. Remove the specinclude values and frame the conditional part directly as a specification header.

    /Dinesh
  • Yevo
    Yevo
    280 Posts

    Re: how can i add #ifdef ... #endif to headfilies in a SpecInclude file?

    ‏2012-05-23T09:46:37Z  
    SpecificationProlog or ImplementationProlog may be useful if you are going to add this code to package or class.
  • buptxch
    buptxch
    31 Posts

    Re: how can i add #ifdef ... #endif to headfilies in a SpecInclude file?

    ‏2012-05-23T14:41:47Z  
    • Yevo
    • ‏2012-05-23T09:46:37Z
    SpecificationProlog or ImplementationProlog may be useful if you are going to add this code to package or class.
    thanks, i found this,it works for class,attributes,operations, relations and so on,but not for headfiles.