From a2345930911ef817319111570b3d76881432959c Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Mon, 19 Aug 2013 23:27:47 +0100
Subject: [PATCH] [Change] WARN and ERR now generate asserts in debug mode.

---
 AUTHORS   |  1 +
 src/log.h | 10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 36df40b..1aa8266 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -14,6 +14,7 @@ Contributors:
 			* Testing.
 
 Past Contributors:
+
  -- KonoM (Tamir Atias)
  		* Lazy ass.
 		* Bug Squatter.
diff --git a/src/log.h b/src/log.h
index d0ebe44..8c9eeed 100644
--- a/src/log.h
+++ b/src/log.h
@@ -1,10 +1,16 @@
 #pragma once
 #include <stdio.h>
 
+/* We'll use asserts in DEBUG if defined. */
+#ifndef DEBUG
+#  define NODEBUG
+#endif /* DEBUG */
+#include <assert.h>
+
 #define LOG(str, args...)(fprintf(stdout, str"\n", ## args))
-#define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args))
+#define WARN(str, args...)(fprintf(stderr, "Warning: "str"\n", ## args), assert(0))
 #define ERR(str, args...) (fprintf(stderr, "ERROR %s:%d: [%s] "str"\n", \
-  __FILE__, __LINE__, __func__, ## args))
+  __FILE__, __LINE__, __func__, ## args), assert(0))
 
 #ifdef DEBUG
 #  undef DEBUG