tags:

views:

518

answers:

2

I have #define values in headers that I certainly want Doxygen to document but I have others in C files that I treat as static constants and I don't want Doxygen to document them. Something as simple and stupid as

#define NUMBER_OF(a) (sizeof((a))/sizeof((a)[0]))
#define MSTR(e) #e

How can I keep Doxygen from putting those #defines in the documentation it creates? I've tried marking it with @internal but that didn't seem to help.

A somewhat-related question on Doxygen and #define, how can I get:

#define SOME_CONSTANT 1234 /**< An explanation */

to put "SOME_CONSTANT" and "An explanation" but not "1234" in the output?

+1  A: 

You can exclude any part of code from Doxygen parsing with \cond ... \endcond tags.

edit: Some related questions:

mouviciel
I suppose that addresses the #define in .c file issue (I can surround those lines with conditional control). It seems noisy and unnatural, though. And doesn't at all address hiding values for #define'd constants. (Maybe I shouldn't have asked a compound question but I hoped there was some #define-specific stuff that might address both issues.)
Chris Nelson
I don't know how to reveal a define constant without revealing its value.
mouviciel
I've got cond/endcond working but I really would like to know why internal didn't work. My doxygen fu is definitely weak. :-(
Chris Nelson
Unfortunately, I share your misunderstanding of @internal. Many aspects of Doxygen are still obscure for me. The learning curve is slow but worth.
mouviciel
A: 

It will no doubt still seem noisy and unnatural, but to address your other question, try:

/** An explanation */
#define SOME_CONSTANT /** @cond */ 1234 /** @endcond */
Ben Hocking