From 043bc3b0580105ec7be33c1d479c070b3b6fe039 Mon Sep 17 00:00:00 2001 From: Rex Jolliff Date: Sun, 29 Nov 1998 19:11:10 +0000 Subject: [PATCH] added support for CHECKED macro svn path=/trunk/; revision=98 --- reactos/include/internal/debug.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/include/internal/debug.h b/reactos/include/internal/debug.h index bd2d7ef01b7..28869d2c526 100644 --- a/reactos/include/internal/debug.h +++ b/reactos/include/internal/debug.h @@ -25,16 +25,24 @@ #define UNIMPLEMENTED do {DbgPrint("%s at %s:%d is unimplemented, have a nice day\n",__FUNCTION__,__FILE__,__LINE__); for(;;); } while(0); +/* FIXME: should probably remove this later */ +#if !defined(CHECKED) && !defined(NDEBUG) +#define CHECKED +#endif + +#ifdef CHECKED +#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); } +#else +#define assert(x) +#endif + #ifndef NDEBUG #define OLD_DPRINT(fmt,args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(fmt,args); } while(0); #define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); ExAllocatePool(NonPagedPool,0); } while(0); -//#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); (*((unsigned int *)0))=1; for (;;); } -#define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for (;;); } #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); ExAllocatePool(NonPagedPool,0); } while(0); #else #define DPRINT(args...) #define OLD_DPRINT(args...) -#define assert(x) #define CHECKPOINT #endif /* NDEBUG */