Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

c - Doxygen callgraph with macro to the function

I am trying to generate the callgraph for the main function in the following code, where I pass the MODE_A as predefine.

void FOO(int a);
void ZOO(int a);


#ifdef MODE_A
    #define function    FOO
#else
    #define function    ZOO
#endif

/**
 * @callgraph
 */
int main()
{
    function(69);
}

void FOO(int a){    cout << "FOO " << a;}

void ZOO(int a){    cout << "ZOO " << a;}

my settings in the Doxyfile are:

# Difference with default Doxyfile 1.8.20 (f246dd2f1c58eea39ea3f50c108019e4d4137bd5)
OPTIMIZE_OUTPUT_FOR_C  = YES
EXTRACT_ALL            = YES
CASE_SENSE_NAMES       = YES
GENERATE_TREEVIEW      = YES
MACRO_EXPANSION        = YES
PREDEFINED             = MODE_A
EXPAND_AS_DEFINED      = function
SKIP_FUNCTION_MACROS   = NO
HAVE_DOT               = YES

I even tried EXPAND_ONLY_PREDEF = YES. Is there any other setting I can try?

Debug Update I dumped the pre-processor output for the above code using doxygen -d Preprocessor. And did the same with macro function replaced with FOO. In both cases the output was exactly the same, which is as follows:

00014 /**
00015  * @callgraph
00016 */
00017 int main()
00018 {
00019     FOO(34);
00020 }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...