[Doxygen-users] Preprocessor MACRO_EXPANSION + EXPAND_ONLY_PREDEF issue
Brought to you by:
dimitri
From: Torsten H. <A1...@gm...> - 2015-01-14 06:44:12
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Hello Mailinglist,</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">I want to expand macro function in my code. If I use a global setting, its works correct, but if I want to do macro expansion only for individual macros it don't expand correct.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">I added an example code to test it with the following settings (Doxy Wizard – Preprocessor tab):</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Working case</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">===========================================================</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENABLE_PREPROCESSING - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MACRO_EXPANSION - not set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EXPAND_ONLY_PREDEF - not set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">SEARCH_INCLUDE - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">INCLUDE_PATH</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">INCLUDE_FILE_PATTERNS</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">PREDEFINED</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EXPAND_AS_DEFINED</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">SKIP_FUNCTION_AS_DEFINED - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Not working case</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">===========================================================</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENABLE_PREPROCESSING - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MACRO_EXPANSION - not set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EXPAND_ONLY_PREDEF - not set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">SEARCH_INCLUDE - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">INCLUDE_PATH</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">INCLUDE_FILE_PATTERNS</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">PREDEFINED</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">-empty</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EXPAND_AS_DEFINED</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">- EVENTTYPE_TABLE</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">- ENTRY</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">SKIP_FUNCTION_AS_DEFINED - set</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Additional comment</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">===========================================================</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">It's only documentated what happen if EXPAND_AS_DEFINED has entries and PREDEFINED and EXPAND_AS_DEFINED is set. It's not defined what happen if only one is set.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">It seems that Macro's are skiped if EXPAND_AS_DEFINED has entries and is not set.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">I hope some one has an idea whats going work. Is it a still a bug in doxygen or it is my fault.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Best regrads</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">Torsten</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MacroTest.h</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">===========================================================</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** For an overview of the mappings of these events to the handling methods in</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MacroTest, see @ref MacroTest.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">@file MacroTest.h</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">*/</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// This is a documentation comment</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">enum TypeType_t</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">{</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">bla1,</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">bla2,</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">PROGRAM_INTERNAL_ET = INT_MAX ///< Do not touch this. Required for ensuring consistent enum type size across libraries.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">};</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** For an overview of the mappings of these events to the handling methods in</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MacroTest, see @ref MacroTest.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">@file MacroTest.h</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">*/</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** @brief Program event types.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">*/</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">#define EVENTTYPE_TABLE \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** A key was pressed down. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_KEYDOWN) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** A key was released. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_KEYUP) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** A character key was pressed. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_CHAR) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The mouse was moved while a button was pressed. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(DEPRECATED_ET_MOUSEDRAG) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The mouse was moved while all buttons were released. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_MOUSEMOVE) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The mousewheel was used. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_MOUSEWHEEL) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The left mouse button was released. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_LBUTTONUP) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The left mouse button was pressed. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_LBUTTONDOWN) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The left mouse button was double clicked. @ref CGUIEventHandler::GetDoubleClickTime() */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(DEPRECATED_ET_LBUTTONDBLCLK) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The right mouse button was released. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_RBUTTONUP) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The right mouse button was pressed. */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_RBUTTONDOWN) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** The left mouse button was pressed longer than @ref CGUIEventHandler::GetLongClickTime(). */ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(DEPRECATED_ET_LBUTTONLONGCLICK) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** A hot key was pressed (used on e.g. smart phones)*/ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_HOTKEYDOWN) \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/** A hot key was released (used on e.g. smart phones)*/ \</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">ENTRY(ET_HOTKEYUP)</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// This is a documentation comment</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">enum EventType_t</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">{</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">#define ENTRY(a) a,</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EVENTTYPE_TABLE</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">#undef ENTRY</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">PROGRAM_INTERNAL_ET = INT_MAX ///< Do not touch this. Required for ensuring consistent enum type size across libraries.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">};</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// MacroTest special doc</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Special comment bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">class MacroTest</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">{</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">public:</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Constructor</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MacroTest();</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Destructor</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">~MacroTest();</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Getter</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// @param i The param to get</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// @return Pointer to MacroTest.</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">MacroTest *GetMacro(int i ) {return this;};</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Setter</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// bla bla bla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// @param i The param to get</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">void SetMacro(int i ) {MacroTest i = 0;};</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;"> </p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Super duper member</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">int m_i;</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// BLABLA</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">EventType_t m_EventType;</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">/// Blabla</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">TypeType_t m_TypeType;</p> <p style="margin-bottom: 0.0cm;line-height: 100.0%;">}</p> </div> </div> </div></div></body></html> |