展开非功能宏对C doxygen的文档中 [英] Expand non-function macros in doxygen documentation for C

查看:177
本文介绍了展开非功能宏对C doxygen的文档中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想记录我的C code。使用doxygen的。我设置为与宏命令#define一些默认值。 (我知道C没有默认值,但是这仅仅是一个例子)

I am trying to document my C code using doxygen. I have some default values set as macros with #define. (I know C does not have default values but this is just an example)

例如:

#define DEFAULT_WIDTH  100
#define DEFAULT_HEIGHT 200

里面的doxygen我也补充说,在处理我想要的方式默认值的别名。考虑下面

Inside doxygen I have added an alias that handles default values in the way I want. Consider the example function below

//! Initializes something
//! @param width The width @default DEFAULT_WIDTH
//! @param height The height @default DEFAULT_HEIGHT
//! @return Result of initialization
char initSomething(int width,int height);

这将生成的文档,我希望它只是一个重要的事实。 DEFAULT_WIDTH和DEFAULT_HEIGHT没有得到扩大,我得到的宏名和不分别100和200。我确实有MACRO_EXPANSION和ENABLE_ prePROCESSING检查上。

This will generate the documentation as I want it except one important fact. DEFAULT_WIDTH and DEFAULT_HEIGHT do not get expanded , I get the macro names and not 100 and 200 respectively. I do have MACRO_EXPANSION and ENABLE_PREPROCESSING checked on.

我在想什么?是否有任何实际的方式来实现这一目标的doxygen使用?

What am I missing? Is there actually any way to achieve this using doxygen?

我与配置的doxygen doxywizard和我目前在Windows下进行测试。

I am configuring doxygen with doxywizard and I am currently testing under Windows.

编辑:ugoren指出,有可能只是记录宏,然后将该文件的doxygen将链接到他们。这是我目前的实现是如何在我的项目其实。但我想考虑其他选项 - 如果有的话

As ugoren points out it is possible to just document the macro and then doxygen will link that documentation to them. This is how my current implementation is in my project actually. But I am trying to consider additional options - if any exist.

推荐答案

添加类似

EXPAND_AS_DEFINED += DEFAULT_WIDTH

您doxygen的配置文件。

to your doxygen configuration file.

(P99的文档充满了这样的宏展开的,其doxygen的配置文件应该有分布。)

(The documentation of P99 is full of such macro expansions. Its doxygen configuration file should come with the distribution.)

这篇关于展开非功能宏对C doxygen的文档中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆