Last active
May 4, 2021 03:58
-
-
Save yamamaya/26423b0f5d5182d73e4fc90a015e4659 to your computer and use it in GitHub Desktop.
Macro to turn on/off the debug code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DEBUGMODE | |
#ifdef DEBUGMODE | |
#define DEBUG(x) _DEBUG(,x) | |
#define _DEBUG(dummy,x) dummy##x | |
#else | |
#define DEBUG(x) | |
#endif | |
void func( void ) { | |
DEBUG( printf( "debug message\n" ) ); | |
DEBUG( | |
printf( "more " ); | |
printf( "debug message\n" ); | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment