Is it possible to document a typedef that depending on a preprocessor define has different types in a way that displays both alternatives in html output using Doxygen?
The code I'd like to document:
/**
* \file
*/
#ifdef _WIN32
/**
* Documentation for Windows goes here...
*/
typedef wchar_t MyChar;
#else
/**
* Documentation for Non-Windows goes here...
*/
typedef char MyChar;
#endif
I've tested several preprocessor-related settings, but I could only change the typedef displayed in the html output or merge the documentation. I even managed to have one typedef show up in the overview section of the file and the other one in the detailed description. However I wasn't able to make both alternatives show up simultaneously.
I managed to produce the following 2 alternatives:
----------------------------------------------
typedef wchar_t | MyChar | ....
----------------------------------------------
----------------------------------------------
typedef char | MyChar | ....
----------------------------------------------
But not something like this
----------------------------------------------
typedef wchar_t | MyChar | ....
----------------------------------------------
typedef char | MyChar | ....
----------------------------------------------
Note: I don't mind modifying the source code as long as
- In the documentation both alternatives are reasonably documented in the Doxygen output; both
wchar_t
andchar
need to be displayed in thetypedef ...
part - The compiler produces the same result for the modified and the current version of the file
- IDE autocompletion, in particular Visual Studio 2019's IntelliSense, still displays reasonable tooltips (optional)