[ros-dev] RE: [ros-svn] [chorns] 19566: Speed up compilation of ntoskrnl

Hartmut Birr osexpert at googlemail.com
Fri Nov 25 23:01:29 CET 2005


Ge van Geldorp wrote:
>> From: chorns at svn.reactos.com
>>
>> Speed up compilation of ntoskrnl
>>     
>
> Hmm, an unexpected consequence is that we can no longer enable DPRINTs per
> file by removing the "#define NDEBUG" statement. At the moment, the first
> source files included by io.c and cc.c (resp io/adapter.c and cc/cacheman.c)
> don't define NDEBUG before including debug.h. As a result, all DPRINTs in
> every file included by io.c/cc.c are enabled.
>
> GvG
>
> _______________________________________________
>   
I see the same problem. I've fixed it, by modifying debug.h. Now you
have to add an explicit statement #undef NDEBUG.

- Hartmut


-------------- next part --------------
Index: ntoskrnl/include/internal/debug.h
===================================================================
--- ntoskrnl/include/internal/debug.h	(Revision 19569)
+++ ntoskrnl/include/internal/debug.h	(Arbeitskopie)
@@ -15,6 +15,30 @@
  *        Define NASSERT before including this header to disable assertions
  */
 
+#ifdef CHECKPOINT
+#undef CHECKPOINT
+#endif
+
+#ifdef DPRINT
+#undef DPRINT
+#endif
+
+#ifndef NDEBUG
+#ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
+#define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
+#else
+#define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint
+#endif
+#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0)
+#else /* NDEBUG */
+#ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
+#define DPRINT(args...)
+#else
+#define DPRINT
+#endif
+#define CHECKPOINT
+#endif /* NDEBUG */
+
 #ifndef __INTERNAL_DEBUG
 #define __INTERNAL_DEBUG
 
@@ -91,26 +115,8 @@
 #endif /* !__USE_W32API */
 
 #endif /* DBG */
-
 #define CHECKPOINT1 do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0)
 
-#ifndef NDEBUG
-#ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
-#define DPRINT(args...) do { DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
-#else
-#define DPRINT DbgPrint("(%s:%d) ",__FILE__,__LINE__); DbgPrint
-#endif
-#define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0)
-#else /* NDEBUG */
-#ifdef __GNUC__ /* using GNU C/C99 macro ellipsis */
-#define DPRINT(args...)
-#else
-#define DPRINT
-#endif
-#define CHECKPOINT
-#endif /* NDEBUG */
-
-
 /*
  * FUNCTION: Assert a maximum value for the current irql
  * ARGUMENTS:


More information about the Ros-dev mailing list