1

I have macros in C source files that generate function declarations as well as for structures.

I made the decision to use doxygen in order to document them, but as long as my source file does not explicitly contain the declaration, doxygen is not generating the appropriate documentation.

Here is a little example; I have a macro that is a kind of idiom for a class declaration:

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

So instead of writing:

    /**
  * \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;

I may write instead:

/**
  * \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) */
    /*@}*/
};

But for the second case, doxygen does not generate the documentation regarding my struct members.

How could I find a compliant solution to such an issue?

Randy Howard
  • 2,165
  • 16
  • 26
Geoffrey R.
  • 1,907
  • 1
  • 19
  • 32

0 Answers0