Details
Diff Detail
- Repository
- rEFL core/efl
- Branch
- T7382-devs/cedric/homogeneous
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 8905
I am not sure. I am afraid of the hard to read part of it.
The macro can include the docs also, and Doxygen will pick them up just fine.
That was something I didn't know. So if I have a macro that generate function, it will actually generate independent Doxygen comment for each of them ? How does that work ? Do you have example?
if you have plan to update the patch with macro by @segfaultxavi's comment's I'll be waiting it.
the patch is buildable and test passed, all good so far.
I knew it could be done, but I had to work a bit to have it done:
test.h:
/// @brief For internal use only. /// @hideinitializer #define PRINT_CHAR(ch,doc) \ /** @brief doc */ \ void print_ ## ch () { \ printf( # ch "\n"); \ } PRINT_CHAR(a, "Prints an A") PRINT_CHAR(b, "Prints a B")
The above code defines two functions print_a() and print_b() both with documentation text, which is controlled from the macro parameters.
In order for Doxygen to actually expand the macros and use the expanded comments, some Doxygen options need to be set:
Doxyfile: (I am showing the relevant lines)
#--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES EXPAND_AS_DEFINED = PRINT_CHAR
All these are the values we are already currently using, except EXPAND_AS_DEFINED! Awesome!
I would have liked to hide the PRINT_CHAR macro completely from the output, but I could not manage. It it is not shown, the macros are not expanded either. The above code is the nicest I could manage.
In summary, I think it is worth trying this because otherwise you are adding 500 lines of extremely repeated code :/
Some other portions of this header could also benefit from this approach.
I think this macro looks nice work but seems @segfaultxavi again review once about it? I 'll leave the decision on you @cedric
I am still reviewing it. It does not seem to work for me. Have you guys been able to see the html output?
Update Doxyfile so .x files are also processed.
Add new functions into a group.
Cleanup comments.