Skip to content

Instantly share code, notes, and snippets.

@reidrac
Created June 12, 2011 10:11
Show Gist options
  • Save reidrac/1021402 to your computer and use it in GitHub Desktop.
Save reidrac/1021402 to your computer and use it in GitHub Desktop.
Awesome C debug macro
#define DEBUG(fmt, args...) fprintf(stderr, "DEBUG[%s:%d]: "fmt, __FILE__, __LINE__, args)
/* disable debug logs */
#undef DEBUG
#define DEBUG(args...) /* args */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment