From: Alex Ionescu Date: Fri, 29 Jul 2005 00:14:05 +0000 (+0000) Subject: - Fix debug header, spottted by Gunnar X-Git-Tag: ReactOS-0.2.8~1485 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=ddb24faedc8119c4fcc0e8ec5a47908aaa638530;hp=a661e95cdf19d062d4c39b4b1bd74a5beb3b8184 - Fix debug header, spottted by Gunnar svn path=/trunk/; revision=16850 --- diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index db86a7ff08e..87b3f25731a 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -16,7 +16,6 @@ #ifndef __INTERNAL_DEBUG #define __INTERNAL_DEBUG -//#define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); #define UNIMPLEMENTED DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__); /* FIXME: should probably remove this later */ @@ -48,31 +47,34 @@ #endif #endif -/* TODO: Make the output of file/line and the debug message atomic */ +/* Print stuff only on Debug Builds*/ #ifdef DBG -#define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint -#define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); -#else -#ifdef __GNUC__ -#define DPRINT1(args...) -#define CHECKPOINT1 -#else -#define DPRINT1 -#define CHECKPOINT1 -#endif /* __GNUC__ */ -#endif + + /* These are always printed */ + #define DPRINT1 DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint + #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); + + /* These are printed only if NDEBUG is NOT defined */ + #ifndef NDEBUG + + #define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__), DbgPrint + #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); + + #else + + #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #define CHECKPOINT + + #endif -#ifndef NDEBUG -#define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) -#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); -#else -#ifdef __GNUC__ -#define DPRINT(args...) #else -#define DPRINT -#endif /* __GNUC__ */ -#define CHECKPOINT -#endif /* NDEBUG */ + + /* On non-debug builds, we never show these */ + #define DPRINT1 do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #define CHECKPOINT1 + #define CHECKPOINT +#endif /* * FUNCTION: Assert a maximum value for the current irql