doxygen预处理C文件

时间:2016-04-06 22:08:30

标签: c c-preprocessor doxygen

我有以下 C 代码,我想用doxygen预处理并生成一个调用图(我设置ENABLE_PREPROCESSING = TRUE):

#define CALL_ENABLE 1
#define REPORT_ERROR_TEST 0

#if (CALL_ENABLE == 1)
void FuncLogError()
{
   #if (REPORT_ERROR_TEST == 1)
   FuncReportStatus();
   #endif
}
#endif

在调用图中,我获得FuncLogError次调用FuncReportStatus,尽管const REPORT_ERROR_TEST等于0.似乎条件#if (REPORT_ERROR_TEST == 1)忽略了预处理。

2 个答案:

答案 0 :(得分:0)

你告诉doxygen关于宏值吗?如果没有,请使用

PREDEFINED=CALL_ENABLE=1
PREDEFINED+=REPORT_ERROR_TEST=0
MACRO_EXPANSION=YES
在doxygen配置文件中

答案 1 :(得分:0)

根据您的需要,您可以禁用doxygen完成的预处理:

# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
# C-preprocessor directives found in the sources and include files.
# The default value is: YES.

ENABLE_PREPROCESSING   = YES
相关问题