[Doxygen-users] Getting macro expansion to work
Brought to you by:
dimitri
From: Simon W. <sim...@ma...> - 2001-10-11 09:46:43
|
I just cant seem to get a C++ #define'd macro to be expanded before documentation. I have set: MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES EXPAND_AS_DEFINED = ((macros)) The macros I need to expand expand to inline accessor methods in a class, each macro giving two or three methods. I have already set up the build to put all my header files into the INPUTS config param (massaging g++ -MM output). The manual section on Preprocessing give examples of the use of PREDEFINED, but not EXPAND_AS_DEFINED. My macros have the form: #define ACCESS_STRING(NAME,FIELD,LENGTH) \ string get_ ## NAME () {\ return string (data.FIELD, LENGTH);\ }\ ---><8--- similar for set_ #define ITERATOR(NAME,TYPE,INFO) \ TYPE::iterator begin_ ## NAME () {\ return begin_tmpl < TYPE > (INFO);\ }\ ---><8--- similar for end_ and add_ So my EXPAND_AS_DEFINED field is EXPAND_AS_DEFINED = "ACCESS_STRING(NAME,FIELD,LENGTH)" \ "ITERATOR(NAME,TYPE,INFO)" I have checked the C++ pre-processor output, and these are correctly defined in the resultant .ii file. In the Doxygen (1.2.1) output, The "ACCESS_STRING" macro appears once or not at all in the doc (HTML). Where it appears, it is as a method without return, eg: Patient::ACCESS_STRING (name, p_name, 17) While the "ITERATOR" macro doesnt appear in the class docs at all. Both are documented as macros though. So, what is confusing Doxygen (pre-processor) here? Si. -- Simon A Watts Software Engineer Marconi Medical Systems mailto:sim...@ma... tel: +44(0) 1252 747 311 |