最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c++ - How can I get doxygen to see a member function declared via macro+include? - Stack Overflow

programmeradmin4浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论