Skip to content

Instantly share code, notes, and snippets.

@joe-sullivan
Created July 14, 2016 19:26
Show Gist options
  • Save joe-sullivan/8107e24ddd73a2a600683beef23b838e to your computer and use it in GitHub Desktop.
Save joe-sullivan/8107e24ddd73a2a600683beef23b838e to your computer and use it in GitHub Desktop.
Debug macro C

Sample Usage

import "debug.h"

void foo() {
	D printf("I'm a debug statement\n");
}

Compile

gcc -DDEBUG foo.c

#ifdef DEBUG
# define D if(1)
#else
# define D if(0)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment