【问题标题】:doxygen preprocessing C filedoxygen 预处理 C 文件
【发布时间】:2016-04-06 22:08:29
【问题描述】:

我有以下 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)

【问题讨论】:

    标签: c c-preprocessor doxygen


    【解决方案1】:

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

    PREDEFINED=CALL_ENABLE=1
    PREDEFINED+=REPORT_ERROR_TEST=0
    MACRO_EXPANSION=YES
    

    在 doxygen 配置文件中。

    【讨论】:

      【解决方案2】:

      根据您的需要,您可以禁用 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
      

      【讨论】:

        猜你喜欢
        • 2023-03-10
        • 2018-06-18
        • 2016-10-04
        • 1970-01-01
        • 2015-08-28
        • 1970-01-01
        • 2011-09-22
        • 2019-10-07
        • 2011-01-22
        相关资源
        最近更新 更多