0

I often have code like this:

#define limit_0 1.0f    /**< Limit 0 */
#define limit_1 3.5     /**< Limit 1 */
#define limit_2 2       /**< Limit 2 */

and in this case the Doxygen HTML documentation ("Macro Definition Documentation") looks bad. A lot of overhead and a lot of lines.

I like the compact Enumerations documentation. For the example above I would like to have something like:

name value details
limit_0 1.0f Limit 0
limit_1 3.5 Limit 1
limit_2 2 Limit 2

Is this possible?

morric
  • 1,189
  • 1
  • 13
  • 17
  • In general documenting a `define` after a name is not the best idea as it get into the code used by doxygen as well and give some unexpected results e.g. if case `if (x < limit_1)`. Maybe a bit a better layout for you would be to use the `\brief` command. Further there are, to the best of my knowledge, no solutions for this. – albert Sep 17 '21 at 11:53
  • The Doxygen manual says that `<`-marked documentation comments can only be used to document *members* and *parameters*, so you should not use them to document macros. – Ian Abbott Sep 17 '21 at 12:56
  • Adding \brief makes the output much better. Now everything is documented in the Macros section and there is no “Detailed Macro Description” anymore. Thx albert The inline documentation is working and should be safe, since the comments are replaced with a single space in the tokenization phase, which happens before the preprocessing phase where macros are expanded. At least since C99. https://stackoverflow.com/questions/1510869/does-the-c-preprocessor-strip-comments-or-expand-macros-first – user186299 Sep 17 '21 at 14:11

0 Answers0