Skip to content

Instantly share code, notes, and snippets.

@jubstuff
Created October 11, 2011 18:45
Show Gist options
  • Save jubstuff/1278998 to your computer and use it in GitHub Desktop.
Save jubstuff/1278998 to your computer and use it in GitHub Desktop.
/*
* compile_directives.c
*
* Define a DEBUG macro that put the program in Development environment
*
* Use:
* gcc -Wall -DDEV_ENV compile_directives.c -o compile_directives.out
*
* Author: giustinob[a t]gmail.com
*
**/
#include <stdio.h>
#ifdef DEV_ENV
#define DEBUG 1
#else
#define DEBUG 0
#endif
int main()
{
if(DEBUG)
{
printf("Development environment\n");
}
else
{
printf("Production environment\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment