Jump to content

Recommended Posts

I'm creating code that needs to be compiled by both the C2C and the BOOSTC compilers. Unfortunately there needs to be some minor code differences for each compiler, so I need to make use of conditional compilation (and the most obvious way would be to use #ifdef).

 

Do either (hopefully both) of these compilers create their own definitions so that I could use code similar to that below?

 

#ifdef _C2C
 delay_us(20);
#endif
#ifdef _BOOSTC
 delay_10us(2);
#endif

 

Steve.

Link to post
Share on other sites

Steve,

 

Do either (hopefully both) of these compilers create their own definitions so that I could use code similar to that below?

 

#ifdef _C2C
 delay_us(20);
#endif
#ifdef _BOOSTC
 delay_10us(2);
#endif

 

Use:

#ifdef _BOOSTC
    ...
#else
    ...
#endif

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...