Skip to content

Instantly share code, notes, and snippets.

@m2kar
Created November 19, 2019 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m2kar/6c9acef7a7cbf6540f40f74f5756be35 to your computer and use it in GitHub Desktop.
Save m2kar/6c9acef7a7cbf6540f40f74f5756be35 to your computer and use it in GitHub Desktop.
C语言方便调试的宏
// some debug Macro
// #define DEBUG
#ifndef DEBUG_PRINT
#ifdef DEBUG
#define DEBUG_PRINT(fmt, args...) fprintf(stderr, fmt, ## args)
#else
#define DEBUG_PRINT(fmt, args...) /* Don't do anything in release builds */
#endif
#endif //DEBUG_PRINT
#ifndef DEBUG_RUN
#ifdef DEBUG
#define DEBUG_RUN(args) {args ; }
#else
#define DEBUG_RUN(args...)
#endif
#endif //DEBUG_RUN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment