diff --git a/bin/Makefile b/bin/Makefile index 4404638..23f7d1e 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,5 +1,6 @@ # OPTIONS. DEBUG = 1 +#DEBUG_PARANOID = 0 OS := LINUX #OS := WIN32 @@ -32,6 +33,9 @@ ifdef DEBUG CFLAGS += -W -Wall -Wextra -Wunused -Wshadow -Wpointer-arith -Wmissing-prototypes \ -Winline -Wcast-align -Wmissing-declarations -fstack-protector \ -fstack-protector-all -g3 -DDEBUG -DLUA_USE_APICHECK -std=c99 +ifdef DEBUG_PARANOID + CFLAGS += -DDEBUG_PARANOID +endif else CFLAGS += -O2 -funroll-loops -pipe -std=c99 endif diff --git a/src/log.h b/src/log.h index 8c9eeed..2fc6801 100644 --- a/src/log.h +++ b/src/log.h @@ -8,7 +8,12 @@ #include #define LOG(str, args...)(fprintf(stdout, str"\n", ## args)) +#ifdef DEBUG_PARANOID /* Will cause WARN's to blow up. */ #define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args), assert(0)) +#else +#define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args)) +#endif + #define ERR(str, args...) (fprintf(stderr, "ERROR %s:%d: [%s] "str"\n", \ __FILE__, __LINE__, __func__, ## args), assert(0))