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 }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…