[Doxygen-users] doxygen #define question
Brought to you by:
dimitri
From: <hew...@gm...> - 2014-01-09 04:58:11
|
Hi there! I have a question regarding the doxygen preprocessor. In some of my code (.c) modules I have a #define setup to tell the .h file for that module how to behave. For example in the following file (driver.c) I define the constant CDR: #define CDR #include "driver.h" /** @brief Initialize all CAN1 Driver variables. @return none */ void initialize(void) { //! @todo Run some code here... printf("%d", test_file_scope_variable); } Then in the header file (driver.h), I perform certain actions based on whether CDR has been defined. For example, the static variable test_file_scope_variable below is only declared if CDR is defined. #ifdef CDR /* LOCAL definition */ /** @var test_file_scope_variable File Scope variable to Test doxigen */ static u16 test_file_scope_variable; #endif /* CDR */ All the above code works great at the compiler level but when I go to run doxygen the documentation generated never shows test_file_scope_variable since doxygen can't seem to see that CDR has been defined in the C module. Does anyone know how to solve this? I know that I can solve this by defining CDR using the PREDEFINED setting in the doxygen settings. However this will define CDR for the whole project and I only want it defined only for this module and header combination. Thanks! Any help would be greatly appreciated! -Joe |