Exclude more rarely-used stuff from Windows headers (#8513)

This PR defines a series of `NOSOMETHING` macros in PCHs, in order to
prevent `windows.h` from bringing a lot of rarely used things into the
project. 

Theoretically this should make PCH generation and overall complication
faster, but I didn't really benchmark the speed. 

Another benefit would be reducing the symbol noises caused by
`windows.h`.
This commit is contained in:
Chester Liu 2020-12-12 03:35:23 +08:00 committed by GitHub
parent 8f60cfae41
commit 219ee0c654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 37 additions and 0 deletions

View file

@ -1497,6 +1497,7 @@ Nls
NLSMODE
NOACTIVATE
NOAPPLYNOW
NOCOMM
NOCLIP
NOCOLOR
NOCONTEXTHELP
@ -1504,11 +1505,13 @@ NOCOPYBITS
nodiscard
NODUP
noexcept
NOHELP
noinline
NOINTEGRALHEIGHT
NOINTERFACE
NOLINKINFO
nologo
NOMCX
NOMINMAX
NOMOVE
NONALERT

View file

@ -25,6 +25,9 @@ Abstract:
#pragma warning(push)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMCX
#define NOHELP
#define NOCOMM
#endif
// Windows Header Files:

View file

@ -26,6 +26,9 @@ Abstract:
#pragma warning(disable: ALL_CPPCORECHECK_WARNINGS)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define NOMCX
#define NOHELP
#define NOCOMM
#endif
// Windows Header Files:

View file

@ -3,6 +3,9 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // If this is not defined, windows.h includes commdlg.h which defines FindText globally and conflicts with UIAutomation ITextRangeProvider.
#define NOMCX
#define NOHELP
#define NOCOMM
#endif
#include <LibraryIncludes.h>

View file

@ -8,6 +8,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
#include <LibraryIncludes.h>
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the

View file

@ -8,6 +8,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#define BLOCK_TIL

View file

@ -19,6 +19,9 @@ Abstract:
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
#include <unknwn.h>
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)

View file

@ -9,6 +9,9 @@
// Needs to be defined or we get redeclaration errors
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#define BLOCK_TIL

View file

@ -8,6 +8,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#define BLOCK_TIL

View file

@ -8,6 +8,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
// Manually include til after we include Windows.Foundation to give it winrt superpowers
#define BLOCK_TIL

View file

@ -8,6 +8,9 @@
#pragma once
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
#include <LibraryIncludes.h>
// This is inexplicable, but for whatever reason, cppwinrt conflicts with the

View file

@ -19,6 +19,10 @@ Abstract:
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#define NOMCX
#define NOHELP
#define NOCOMM
#include <unknwn.h>
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)