From e26dcb70321eb2aa65845856aaef17946467e401 Mon Sep 17 00:00:00 2001
From: jsalmon3 <>
Date: Mon, 27 May 2002 20:37:49 +0000
Subject: [PATCH] Fixed VC++ Debug macros

---
 src/include/freecraft.h | 61 +++++++++++++----------------------------
 1 file changed, 19 insertions(+), 42 deletions(-)

diff --git a/src/include/freecraft.h b/src/include/freecraft.h
index b3ae45413..1e3889a5a 100644
--- a/src/include/freecraft.h
+++ b/src/include/freecraft.h
@@ -198,40 +198,14 @@
 
 #else	// }{ !__GNUC__
 
-    // FIXME: need useful code for this debug functions!
-
-    /**
-    **	Print debug information of level 0.
-    */
-static inline void DebugLevel0(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 1
-    */
-static inline void DebugLevel1(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 2
-    */
-static inline void DebugLevel2(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 3
-    */
-static inline void DebugLevel3(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 0 with function name.
-    */
-static inline void DebugLevel0Fn(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 1 with function name.
-    */
-static inline void DebugLevel1Fn(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 2 with function name.
-    */
-static inline void DebugLevel2Fn(const char* fmt,...) {};
-    /**
-    **	Print debug information of level 3 with function name.
-    */
-static inline void DebugLevel3Fn(const char* fmt,...) {};
+#define DebugLevel0(args) do { fprintf(stdout,args); } while(0)
+#define DebugLevel1(args) do { fprintf(stdout,args); } while(0)
+#define DebugLevel2(args) do { fprintf(stdout,args); } while(0)
+#define DebugLevel3(args) /* TURNED OFF: do { fprintf(stdout,args); } while(0) */
+#define DebugLevel0Fn(args) do { fprintf(stdout,__FUNCTION__ ": " args); } while(0)
+#define DebugLevel1Fn(args) do { fprintf(stdout,__FUNCTION__ ": " args); } while(0)
+#define DebugLevel2Fn(args) do { fprintf(stdout,__FUNCTION__ ": " args); } while(0)
+#define DebugLevel3Fn(args) /* TURNED OFF: do { fprintf(stdout,__FUNCTION__); fprintf(stdout,args); } while(0) */
 
 #endif	// } !__GNUC__
 
@@ -253,14 +227,17 @@ static inline void DebugLevel3Fn(const char* fmt,...) {};
 
 #else	// }{ __GNUC__
 
-static inline void DebugLevel0(const char* fmt,...) {};
-static inline void DebugLevel1(const char* fmt,...) {};
-static inline void DebugLevel2(const char* fmt,...) {};
-static inline void DebugLevel3(const char* fmt,...) {};
-static inline void DebugLevel0Fn(const char* fmt,...) {};
-static inline void DebugLevel1Fn(const char* fmt,...) {};
-static inline void DebugLevel2Fn(const char* fmt,...) {};
-static inline void DebugLevel3Fn(const char* fmt,...) {};
+#undef _C_
+#define _C_
+
+#define DebugLevel0(fmt)	/* disabled */
+#define DebugLevel1(fmt)	/* disabled */
+#define DebugLevel2(fmt)	/* disabled */
+#define DebugLevel3(fmt)	/* disabled */
+#define DebugLevel0Fn(fmt)	/* disabled */
+#define DebugLevel1Fn(fmt)	/* disabled */
+#define DebugLevel2Fn(fmt)	/* disabled */
+#define DebugLevel3Fn(fmt)	/* disabled */
 
 #endif	// } !__GNUC__