Here is a github repository with a minimal reproduction of my problem:
The source code is two files. A.cpp:
#include <stdint.h>
class A
{
public:
/// comment
void a_public_function();
#define TYPE_MACRO(type) virtual type get_##type() const {return 42;}
#include "all_types.h"
};
int main()
{
A a;
return a.get_int32_t();
}
all_types.h:
#ifndef TYPE_MACRO
#define TYPE_MACRO(x)
#endif
TYPE_MACRO(int8_t)
TYPE_MACRO(int16_t)
TYPE_MACRO(int32_t)
TYPE_MACRO(int64_t)
TYPE_MACRO(float)
#undef TYPE_MACRO
I enabled MACRO_EXPANSION
in the Doxyfile, but it does not help. Whatever setting I use, member functions declared via this include do not appear in the documentation. Is there a way to solve this problem?
This question was marked as duplicate of X-macro breaks doxygen callgraph
But it is not exactly the same problem, and the answers there do not work. I tried adding TYPE_MACRO
to EXPAND_AS_DEFINED
and/or change EXPAND_ONLY_PREDEF
, but it did not work. Setting SKIP_FUNCTION_MACROS
to NO also does not work.