Reasons to reserve using ALL_CAPS for preprocessor macros and manifest constants.

Reasons to reserve using ALL_CAPS for preprocessor macros and manifest constants.

Post by Bjorn Rees » Sat, 07 Oct 2006 03:28:23



Your assumption that all pre-defined macros follow the convension of
using upper-case and/or leading-underscore is invalid. In fact, this
was (part of) what James complained about. He specifically mentioned
"linux", but other examples are "unix" and "sun" (a quick count gave
a total of 13 such macros). The mentioned reference can help you with
these pre-defined macros.

Sure, the reference does not list SDK macros, but that is not its
purpose in the first place. I never claimed that it could be used to
_remove_ the possibility of name collision, only that it could be used
to _reduce_ it.

--
mail1dotstofanetdotdk

--
[ See http://www.yqcomputer.com/ ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
 
 
 

Reasons to reserve using ALL_CAPS for preprocessor macros and manifest constants.

Post by Seungbeom » Sat, 07 Oct 2006 13:04:09


I feel that the site was not intended to answer the question
"What is the complete list of all possible preprocessor identifiers?"
but rather to answer this question
"What preprocessor identifier can I use to test whether this program will
be compiled under a specific standard/compiler/library/OS/architecture?"
This can be a good reference, if you want to make your program portable
with occasionally having to touch outside the realm of the C++ standard.

--
Seungbeom Kim

--
[ See http://www.yqcomputer.com/ ]
[ comp.lang.c++.moderated. First time posters: Do this! ]