【发布时间】:2012-08-07 22:02:50
【问题描述】:
考虑
#define FOOBAR (defined(FOO) || defined(BAR))
#if FOOBAR
/* Do stuff. */
#endif
这应该有效吗?我问是因为显然我的编译器对此没有问题,但 doxygen 内部预处理器认为#if 存在语法错误。我知道我可以解决这个问题
#if defined(FOO) || defined(BAR)
#define FOOBAR 1
#endif
#if FOOBAR
/* Do stuff. */
#endif
【问题讨论】:
标签: c macros doxygen c-preprocessor