代码之家  ›  专栏  ›  技术社区  ›  Sergey

具有属性的Doxygen文档结构成员

  •  0
  • Sergey  · 技术社区  · 6 年前

    我有一个 struct 其中一个字段用注释 gcc type attribute .

    struct str {
        size_t size; /**< Size of string. */
        char string[1] __attribute__ ((aligned(__BIGGEST_ALIGNMENT__))); /**< String. */
    };
    

    当我对此代码运行doxygen时,struct成员 string 不作为引用 Data Field ,但作为一个 Public Member Function . 如何使doxygen将此字段作为 数据场 ?

    P.S.我有绳子 OPTIMIZE_OUTPUT_FOR_C = YES 我的现在 Doxyfile .

    1 回复  |  直到 6 年前
        1
  •  1
  •   albert    6 年前

    如果文件中的行

    char string[1] __attribute__ ((aligned(__BIGGEST_ALIGNMENT__)));

    可以是

    char string[1];

    在doxygen配置文件中定义:

    PREDEFINED = __attribute__((x))=