#ifndef DOXYGEN usage in JUCE codebase

I regularly stumble over sections wrapped in #ifndef DOXYGEN which are parts of the codebase that are obviously not intended to be documented by Doxygen. I think this syntax is quite readable and I’d like to adopt it.

However, I haven’t seen this in any other code so far and googling for it does not give a lot of results for other people doing the same thing. So can I expect this to work in all cases or does it need any special Doxygen settings to get parsed correctly or to make Doxygen activate the DOXYGEN macro while running?

It is specified in the Doxyfile. Here the preprocessing is enabled:

and a few lines there is DOXYGEN=1, so that doxygen doesn’t see these parts. You can use any preprocessor define instead, that’s why you don’t find too many hits searching the web.

Hope that helps

1 Like

Thank you, I came across that file but overlooked the DOXYGEN=1 line so I was unsure if that macro was defined by default. I’m really no Doxygen power-user :sweat_smile: