Условная компиляция

User avatar
HighlanderV
Новичок
Posts: 49
Joined: 05 May 2002 00:08

Post by HighlanderV »

Hey I think it rahter than complicated.


Код:
#define char_val 1
#define double_val 2
#define VAL_(x) x##_val
#define VAL(x) VAL_(x)

#if VAL(ThisType) == VAL(char)
ThisType == char
#endif

#if VAL(ThisType) == VAL(double)
ThisType == double
#endif




How about my version


#if defined(CHAR_TYPE==2)
#define ui8 unsigned char
#elseif defined(CHAR_TYPE==1)
#define i8 char
#endif
...There can be no happiness equal to the joy of finding a heart that understands.

-Victor Robinson

Return to “Вопросы и новости IT”