Вопрос

This seems to be a really trivial task and yet I am not able to get Doxygen to expand the macro. I've used version 1.6.3, 1.7.4, 1.7.6 and 1.8.6. I've also done plenty of searches on Google, but still failed miserably.

I've got a c++ file which contains only the following lines (copied off Doxygen documentation):

#define CONST_STRING const char *
 static CONST_STRING version = "2.xx";

I've followed the documentation and set:

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES

Then added the following:

EXPAND_ONLY_PREDEF     = YES
EXPAND_AS_DEFINED      = CONST_STRING 

then

SKIP_FUNCTION_MACROS   = YES (previously NO)

All I got from the code generation was:

1 #define CONST_STRING const char *
2 static CONST_STRING version = "2.xx";

What have I done wrong? Any advice appreciated.

Это было полезно?

Решение

What makes you think you have done something wrong?

You should be seeing version in the "Variables" section of the documentation page for that source file. If you've enabled source code output, the variable version should hyperlink to that variable documentation.

Your documentation will look much better if you preface the definition of the variable with a doxygen comment. Continuing with this example,

//! Define a constant string type.
//! @deprecated Use the typedef const_string_t instead.
#define CONST_STRING const char *

//! Software version number
static CONST_STRING version = "2.xx";
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top