Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
#ifdef management
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Michael Mair, post: 2435009"] It is more consistent #if defined FOO #elif defined BAR .... #else #endif In addition, you can do things like #if (defined __STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) (parens added for reading convenience) So, the #if defined style offers the same functionality and then some more. If you need this additional functionality, then you get more consistent code if using the second style. BTW: I think of #ifdef/#ifndef as syntactic sugar, as it is an unnecessary shorthand for #if defined/#if !defined... However, I am not very consistent in that as I like my header guards the good old way with #ifndef... ;-) -- in this case, it is entirely sufficient and means "header guards" to me. Cheers Michael [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
#ifdef management
Top