From fd3573b0ed3082e7b02dd131ea5c68da81ded970 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sat, 7 Jan 2006 02:06:22 +0000 Subject: [PATCH] - The DDK disables usage of _enable/_disable so that driver devs don't use them. Since the NDK is the home of undocumented things that drivers shouldn't use, including halfuncs.h will re-enable the intrinsics. - Add the intrinsics to the w32api as well so that code which uses them can compile on both msvc and gcc. - Make DPRINT work on non-DBG msvc builds. svn path=/trunk/; revision=20642 --- reactos/include/ndk/halfuncs.h | 16 +++++++++++++++ reactos/include/reactos/debug.h | 30 +++++++++++++++++------------ reactos/w32api/include/ddk/winddk.h | 4 ++++ 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/reactos/include/ndk/halfuncs.h b/reactos/include/ndk/halfuncs.h index ec0cbd4d132..8c7bb505498 100644 --- a/reactos/include/ndk/halfuncs.h +++ b/reactos/include/ndk/halfuncs.h @@ -27,6 +27,22 @@ Author: #ifndef NTOS_MODE_USER +// +// The DDK steals these away from you. +// +VOID +_enable( + VOID +); +VOID +_disable( + VOID +); +#ifdef _MSC_VER +#pragma intrinsic(_enable) +#pragma intrinsic(_disable) +#endif + // // Display Functions // diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 4d625b02141..852d3f8f921 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -82,7 +82,12 @@ RtlAssert( #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); #else - #ifdef __GNUC__ + #ifdef _MSC_VER + static __inline void DPRINT ( const char* fmt, ... ) + { + UNREFERENCED_PARAMETER(fmt); + } + #else #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #endif #define CHECKPOINT @@ -94,17 +99,18 @@ RtlAssert( #else /* On non-debug builds, we never show these */ -#ifdef _MSC_VER -static __inline void DPRINT1 ( const char* fmt, ... ) -{ -} -static __inline void DPRINT ( const char* fmt, ... ) -{ -} -#else - #define DPRINT1(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) - #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) -#endif + #ifdef _MSC_VER + static __inline void DPRINT1 ( const char* fmt, ... ) + { + } + static __inline void DPRINT ( const char* fmt, ... ) + { + } + #else + #define DPRINT1(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #endif + #define CHECKPOINT1 #define CHECKPOINT #define UNIMPLEMENTED diff --git a/reactos/w32api/include/ddk/winddk.h b/reactos/w32api/include/ddk/winddk.h index 6cc7c8d7f7d..bd5dd1ab85a 100644 --- a/reactos/w32api/include/ddk/winddk.h +++ b/reactos/w32api/include/ddk/winddk.h @@ -10270,6 +10270,10 @@ extern BOOLEAN KdDebuggerEnabled; #endif +/* Available as intrinsics on MSVC */ +static __inline void _disable(void) {__asm__("cli\n\t");} +static __inline void _enable(void) {__asm__("sti\n\t");} + #ifdef __cplusplus } #endif -- 2.17.1