1

我在 C 源文件中有宏,可以生成函数声明以及结构。

我决定使用 doxygen 来记录它们,但只要我的源文件没有明确包含声明,doxygen 就不会生成适当的文档。

这是一个小例子;我有一个宏,它是类声明的一种习惯用法:

#define CLASS(x) \
typedef struct _##x x; \
typedef struct _##x *P##x; \
typedef struct _##x **PP##x; \
typedef struct _##x

所以不要写:

    /**
  * \struct _Vector
  * \brief the vector structure handles stuff to store data accessible by an index.
  */
typedef struct _Vector {
    /*@{*/
    Container   container;      /**< inherits from container */
    size_t      allocated_size; /**< the total allocated size of a vector (private usage) */
    void*       elements;       /**< pointer to the allocated memory space (private usage) */
    /*@}*/
} Vector, *PVector;

我可以改写:

/**
  * \struct _Vector
  * \brief the vector structure handles stuff to store data accessible by an index.
  */
CLASS(Vector) {
    /*@{*/
    Container   container;      /**< inherits from container */
    size_t      allocated_size; /**< the total allocated size of a vector (private usage) */
    void*       elements;       /**< pointer to the allocated memory space (private usage) */
    /*@}*/
};

但是对于第二种情况,doxygen 不会生成有关我的结构成员的文档。

我如何才能找到解决此类问题的合规解决方案?

4

0 回答 0