How to get macros extended by doxygen but not documented as a definition?

Say I have:

#define MY_MACRO(FOO) void FOO(); MY_MACRO(hi); MY_MACRO(hey); MY_MACRO(hello); #undef MY_MACRO 

I want the macros to be extended by doxygen, which I can do by setting it up correctly:

 ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES EXPAND_AS_DEFINED = MY_MACRO 

This allows me to see the extended result of macros as documented APIs on doxygen output ( hi , hey and hello functions). So far so good. But the problem is that doxygen also documents MY_MACRO as a definition. However, I do not want the API clients to know about MY_MACRO , because it is not protected and cannot be used by them and should not be visible to them.

I have EXTRACT_ALL = YES in my doxygen configuration and I don't want to change this. I tried the following configuration without success:

 PREDEFINED = DOXYGEN_SKIP_FOR_USERS 

With the following code:

 #ifndef DOXYGEN_SKIP_FOR_USERS #define MY_MACRO(FOO) void FOO(); #endif /*DOXYGEN_SKIP_FOR_USERS*/ MY_MACRO(hi); MY_MACRO(hey); MY_MACRO(hello); #undef MY_MACRO 

This hides the documentation of the definition, but of course prevents the extension, so I don't get the functions documented in the generated API.

I would be grateful for your help.

+4
source share
1 answer

Suppose MY_ is the prefix that you use sequentially in your code :) I would use the MY__ prefix (two underscores) for internal macros, and then put something like

 EXCLUDE_SYMBOLS = MY__* 

in the Doxygen configuration file.

Edit: double underscore inside characters is reserved for C ++ (not for C). Therefore, if you want to be compatible with C and C ++, you must choose a different type of convention. Unfortunately, the main underscore is also reserved, so _MY_ will not be either.

+6
source

All Articles