如何让 Doxygen 解析包含 __cdecl 的函数指针 typedef?

发布于 2024-10-24 08:46:29 字数 362 浏览 9 评论 0原文

当使用 MS C 或 GNU C 时,需要使用 __cdecl,函数指针原型如下所示:

  • typedef int (__cdecl *funcname_ptr)(void* arg1, const char* arg2 );
  • typedef int(__attribute__((cdecl)) *funcname_ptr)(void* arg1, const char* arg2);

看来 *funcname_ptr 之前的文本会导致 doxygen 的解析器失败。

如果您遇到了这个问题,您找到解决方法了吗?

When using MS C or GNU C where you need to use __cdecl, function pointer prototypes look like:

  • typedef int (__cdecl *funcname_ptr)(void* arg1, const char* arg2);
  • typedef int(__attribute__((cdecl)) *funcname_ptr)(void* arg1, const char* arg2);

It seems that the text prior to *funcname_ptr causes doxygen's parser to fail.

If you have run into this issue, have you found a workaround?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风透绣罗衣 2024-10-31 08:46:29

我还没有遇到这个问题,但一种解决方法可能是使用 预定义选项。

I haven't encountered this problem, but one workaround may be to predefine __cdecl as a macro that evaluates to nothing in the doxygen configuration file using the PREDEFINED option.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文