From ae1cc7c494065e18535b255f7e0cefffdc9f2b5d Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Thu, 22 Aug 2013 18:31:28 +0100
Subject: [PATCH] [Add] Make assert(0) on WARN optional with DEBUG_PARANOID.

---
 bin/Makefile | 4 ++++
 src/log.h    | 5 +++++
 2 files changed, 9 insertions(+)

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 <assert.h>
 
 #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))