From 656e59a392e562aa36709332f15e025949717bed Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Fri, 11 Sep 2015 20:18:12 +0000 Subject: [PATCH] Fix over a hundred thousand warnings by: - Disabling C4214 (nonstandard extension used : bit field types other than int), a somewhat overzealous warning for a "nonstandard" extension we rely on all over. - Defining inactive DPRINT and friends for MSVC using __noop (no not __nop, __noop. See https://msdn.microsoft.com/en-us/library/s6btaxcs.aspx) to get at a whole bunch of C4127 (conditional expression is constant). - Remove the last of the exported DriverEntry from dxg and dxgthk. There is no need in anyw way to export them -- dxg exports DxDdStartupDxGraphics to Win32k for initialization purposes and dxgthk is just a forwarder. Linking to a DriverEntry is to begin with is a pretty bad idea. Say goodbye to the last of LNK4216. svn path=/trunk/; revision=69187 --- reactos/cmake/msvc.cmake | 3 ++- reactos/include/reactos/debug.h | 21 +++++++++++++++++++++ reactos/win32ss/reactx/dxg/dxg.spec | 1 - reactos/win32ss/reactx/dxgthk/dxgthk.spec | 1 - 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index c112f615ccd..5359517fbfe 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -49,7 +49,8 @@ endif () # - C4290: C++ exception specification ignored # - C4800: forcing value to bool 'true' or 'false' (performance warning) # - C4200: nonstandard extension used : zero-sized array in struct/union -add_compile_flags("/wd4244 /wd4290 /wd4800 /wd4200") +# - C4214: nonstandard extension used : bit field types other than int +add_compile_flags("/wd4244 /wd4290 /wd4800 /wd4200 /wd4214") # FIXME: Temporarily disable C4018 until we fix more of the others. CORE-10113 add_compile_flags("/wd4018") diff --git a/reactos/include/reactos/debug.h b/reactos/include/reactos/debug.h index 34a110d237e..e766b969ea3 100644 --- a/reactos/include/reactos/debug.h +++ b/reactos/include/reactos/debug.h @@ -113,7 +113,11 @@ RtlAssert( #else +#if defined(_MSC_VER) + #define DPRINT __noop +#else #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) +#endif #endif @@ -132,6 +136,22 @@ RtlAssert( #else /* not DBG */ /* On non-debug builds, we never show these */ +#if defined(_MSC_VER) + #define DPRINT1 __noop + #define DPRINT __noop + + #define UNIMPLEMENTED + + #define ERR_ __noop + #define WARN_ __noop + #define TRACE_ __noop + #define INFO_ __noop + + #define ERR__ __noop + #define WARN__ __noop + #define TRACE__ __noop + #define INFO__ __noop +#else #define DPRINT1(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) @@ -146,6 +166,7 @@ RtlAssert( #define WARN__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define TRACE__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) #define INFO__(ch, ...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) +#endif /* _MSC_VER */ #endif /* not DBG */ diff --git a/reactos/win32ss/reactx/dxg/dxg.spec b/reactos/win32ss/reactx/dxg/dxg.spec index d9114368705..1b359e0fd2b 100644 --- a/reactos/win32ss/reactx/dxg/dxg.spec +++ b/reactos/win32ss/reactx/dxg/dxg.spec @@ -1,3 +1,2 @@ -@ stdcall DriverEntry(ptr ptr) @ stdcall DxDdCleanupDxGraphics() @ stdcall DxDdStartupDxGraphics(long ptr long ptr ptr ptr) diff --git a/reactos/win32ss/reactx/dxgthk/dxgthk.spec b/reactos/win32ss/reactx/dxgthk/dxgthk.spec index dbe265ef2e0..a95e685a2da 100644 --- a/reactos/win32ss/reactx/dxgthk/dxgthk.spec +++ b/reactos/win32ss/reactx/dxgthk/dxgthk.spec @@ -1,4 +1,3 @@ -@ stdcall DriverEntry(ptr ptr) @ stdcall EngAcquireSemaphore(ptr) win32k.EngAcquireSemaphore @ stdcall EngAllocMem(long long long) win32k.EngAllocMem @ stdcall EngAllocUserMem(long long) win32k.EngAllocUserMem