Home:ALL Converter>Doxygen - Expand macros but ignore #if?

Doxygen - Expand macros but ignore #if?

Ask Time:2011-03-21T02:05:56         Author:RétroX

Json Formatter

Is it possible to tell Doxygen to expand macros but ignore other preprocessor directives?

Take the following into account:

#if defined(linux)
  #define OS_LINUX
  int function() { /* ... */ }
  // Other functions defined for Linux
#elif defined(__WIN32__)
  #define OS_WINDOWS
  int function() { /* ... */ }
  // Other functions defined for Windows
#else
  #error "OS unsupported."
#endif

In this case, I want the functions for both Windows and Linux to show up, but I also want the macros OS_LINUX and OS_WINDOWS to show up in the documentation as well. Is there a way to document both macros while ignoring the #ifs?

Author:RétroX,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/5370369/doxygen-expand-macros-but-ignore-if
yy