PDA

View Full Version : preprocessor directives: #if #elif etc.



graven
07-24-2002, 07:13 AM
#if (5 >= 3)
#warning it is raining 01
#elif (4 >= 3)
#warning it is raining 02
#else
#warning the sun is shining
#endif


will result in: rain01 AND sunshine !

any ideas?

cheers, graven (IS dev 7.04)

graven
07-24-2002, 09:10 AM
another preprocessor directive bug?: #elifdef



#define case01


#ifdef case01
// do something
#elifdef case02
// do something else
#else
// do something totally different
#endif

will result in
error C8059: 'elifdef' : unrecognized preprocessor command"

cheers, graven (IS dev 7.04)

graven
07-24-2002, 09:38 AM
well those two bugs (they definately ARE bugs!) can be worked around the classical ways:

code sample1:


#if (5 >= 3)
#warning it is raining 01
#else
#if (4 >= 3)
#warning it is raining 02
#else
#warning the sun is shining
#endif
#endif
should be bug free, as far as i could see ....

code sample2:


#define case01asdf

#ifdef case01asdf
// do something
#else
#ifdef case02asdf
// do something else
#else
// do something totally different
#endif
#endif
should be bug free, as far as i could see ....

once again: these are bugs!

cheers, graven (IS dev 7.04)

aadavis
07-29-2002, 01:48 PM
Yes, I reported these bugs to IS last year and they confirmed them (SR #1-78TZC and #1-78TU6). I hoped that they would get fixed by now. Looks like they did not.

Tanetal
02-28-2005, 10:46 AM
Greetings
Tanetal

Christopher Painter
02-28-2005, 10:56 AM
Have you tested InstallShield 10.5?