]> git.lizzy.rs Git - bspwm.git/commitdiff
corerctly handle debug messages
authorIvan Kanakarakis <ivan.kanak@gmail.com>
Wed, 3 Oct 2012 17:50:37 +0000 (20:50 +0300)
committerIvan Kanakarakis <ivan.kanak@gmail.com>
Wed, 3 Oct 2012 17:50:37 +0000 (20:50 +0300)
Makefile
helpers.h

index d7256963e9385f29ce77ac2da6df34253b08bbe6..2ffd2acc77bb9ad338a2dffc1c90ed4abf848015 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION = 0.1
 
 CC      = gcc
 LIBS    = -lm -lxcb -lxcb-icccm -lxcb-ewmh
-CFLAGS  = -g -std=c99 -pedantic -Wall -Wextra
+CFLAGS  = -g -std=c99 -pedantic -Wall -Wextra -DDEBUG
 LDFLAGS = $(LIBS)
 
 PREFIX    ?= /usr/local
index e89fa09f6dae94a965fe595c0e169bfb5c5451dc..97e667aa0491c1d74af6cdcded77671f8044c263 100644 (file)
--- a/helpers.h
+++ b/helpers.h
 #define XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
 #define XCB_CONFIG_WINDOW_X_Y XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
 
-#if 1
-#  define PUTS(x)            puts(x);
-#  define PRINTF(x,...)      printf(x, ##__VA_ARGS__);
+#ifdef DEBUG
+#  define PUTS(x)         puts(x)
+#  define PRINTF(x,...)   printf(x, ##__VA_ARGS__)
 #else
-#  define PUTS(x)            ;
-#  define PRINTF(x)          ;
+#  define PUTS(x)         ((void)0)
+#  define PRINTF(x,...)   ((void)0)
 #endif
 
 void logmsg(FILE *, char *, va_list);