English 中文(简体)
Doxygen to document a function that sent to a MACRO C++
原标题:Use Doxygen to document a function that is sent to a MACRO C++

最近,我们在使用MACROS收集时间时添加了一些代码,以贴标签。 现在,Doxygen没有适当记录折旧功能。

    #if defined(__GNUC__)
    #define DEPRECATED(func) func __attribute__((deprecated)) /**< mark a function as deprecated in gcc. */ 

    #elif defined(_MSC_VER)
    #define DEPRECATED(func) __declspec(deprecated) func /**< mark a function as deprecated in msvc. */
    #endif

注是该员额的宏观版本,即实际的宏观方法确实是编篡者版本检查等。

Later the macros are used around a function to let the compiler know that the function has been deprecated so a compiler warning will be issued.

    /**
     * myMethod() is deprecated.
     */
    DEPRECATED(
        /**
         * @deprecated
         * Description of deprecated function
         * 
         * @param var this is a parameter
         *
         * @return this is returned 
         */
        int myMethod(int var)
    );

The problem is that Doxygen wants to show the documentation for DEPRECATED not for myMethod(int var).

是否有任何人知道如何用Doxygen来记录我的血友,而不是宏观的DEPRECA。

最佳回答

You should tell doxygen that it has to remove the DEPRECATED macro. You can do this using the following preprocessor options in the configuration file:

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = YES
PREDEFINED             = "DEPRECATED(x)=x"

您可以通过使用<代码>-d Preprocessor 选项的 d氧来推断预处理结果。 如果存在这一选择,Doxygen将在进行预处理后将投入文件提交产出。

更多信息见

问题回答

Use the @fn tag to explicitly tell what the block is referring to. Not as convenient as the implicit connection, but safer.





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签