Print function only prints if debugging is enabled

I want to keep actual output to a minimum when running a release
version.
This commit is contained in:
Bryan Schumaker 2011-08-21 15:27:59 -04:00
parent bf3d41f8d2
commit b939fa12a4
2 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,7 @@ DIRS = libsaria gui
CLEANDIRS = $(DIRS:%=clean-%)
ifeq ($(DEBUG), y)
export CFLAGS = -Wall -Werror -g
export CFLAGS = -Wall -Werror -g -DDEBUG
else
export CFLAGS = -O2
endif

View File

@ -4,7 +4,13 @@ using namespace std;
#include <libsaria/print.h>
#ifdef DEBUG
void print(string item)
{
cout << item << endl;
}
#else /* DEBUG */
void print(string item)
{
}
#endif /* DEBUG */