Насколько я понимаю, у doxygen есть собственный препроцессор, который будет оценивать #ifdefs.Вы можете определить макросы с помощью опции PREDEFINED
.
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
Однако, поскольку у вас есть #elif, даже если вы установите PREDEFINED = UNIX WIN
, он будет оценивать только первый #ifdef.В качестве альтернативы вы всегда можете попробовать:
#ifdef UNIX
/** some comment */
typedef Key_unix Key;
#endif
#ifdef WIN
/** another comment */
typedef Key_win Key;
#endif
Маловероятно, что при компиляции кода вы определите UNIX и WIN.