extra tokens at end of #ifdef directive

consider the snippet below:

#ifdef AAA && (defined BBB)
...
#endif

gcc-4.5.2 complains on this line:

extra tokens at the end of #ifdef directive.


#ifdef will only work on one token. If you want to use more than one then write

#if defined(AAA) && defined(BBB)

如上所述,如果你想check多个东西是否定义,用下面这种写法,#ifdef只适用于check one thing。

你可能感兴趣的:(Warning)