我正在使用 Doxygen 来记录用 Objective-C 编写的 API。
Doyxygen 无法理解 NS_ENUM typedef。
我找到了这个解决方案,但它对我不起作用。
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = NS_ENUM(x,y)=y
Regards,
Dimitri
这是我的输入文件:
/**
* Represent the possible states.
*/
typedef NS_ENUM(NSInteger, ABEnumType)
{
/**
* State A.
*/
StateA = 0,
/**
* State B.
*/
StateB
};
这是我得到的输出:
Preprocessing /src/ABEnumType.h...
error: /src/ABEnumType.h:17:17: error: C++ requires a type specifier for all declarations [clang]
error: /src/ABEnumType.h:17:28: error: unknown type name 'ABEnumType' [clang]
error: /src/ABEnumType.h:18:1: error: function definition is not allowed here [clang]
error: /src/ABEnumType.h:17:9: error: C++ requires a type specifier for all declarations [clang]
Parsing file /src/ABEnumType.h...