diff --git a/Common/CommonWindows.h b/Common/CommonWindows.h index 4f43edb8ed..367223bb8b 100644 --- a/Common/CommonWindows.h +++ b/Common/CommonWindows.h @@ -1,6 +1,9 @@ #pragma once #ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif #ifndef NOMINMAX #define NOMINMAX #endif diff --git a/Common/Hash.cpp b/Common/Hash.cpp index ae5cfb55b4..d03673db10 100644 --- a/Common/Hash.cpp +++ b/Common/Hash.cpp @@ -22,12 +22,6 @@ #include #endif -#ifdef _WIN32 -// Windows defines min/max which conflict with std::min/std::max. -#undef min -#undef max -#endif - static u64 (*ptrHashFunction)(const u8 *src, int len, u32 samples) = &GetMurmurHash3; // uint32_t diff --git a/Common/StdMutex.h b/Common/StdMutex.h index e5a9cfb1b7..40aeb02cfa 100644 --- a/Common/StdMutex.h +++ b/Common/StdMutex.h @@ -16,7 +16,6 @@ #include #if defined(_WIN32) // WIN32 -#define WIN32_LEAN_AND_MEAN #include "CommonWindows.h" #else // POSIX #include diff --git a/Common/StdThread.h b/Common/StdThread.h index 11d6755579..058e402e24 100644 --- a/Common/StdThread.h +++ b/Common/StdThread.h @@ -28,7 +28,6 @@ #if defined(_WIN32) // WIN32 -#define WIN32_LEAN_AND_MEAN #include "CommonWindows.h" #if defined(_MSC_VER) && defined(_MT) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 123b7efa87..3780819525 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -46,12 +46,6 @@ #include "../../GPU/GPUState.h" #include "../../GPU/GPUInterface.h" -#ifdef _WIN32 -// Windows defines min/max which conflict with std::min/std::max. -#undef min -#undef max -#endif - struct FrameBufferState { u32 topaddr; PspDisplayPixelFormat pspFramebufFormat; diff --git a/Core/HLE/sceKernelTime.cpp b/Core/HLE/sceKernelTime.cpp index 6d32045762..e93866a24b 100644 --- a/Core/HLE/sceKernelTime.cpp +++ b/Core/HLE/sceKernelTime.cpp @@ -16,7 +16,6 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN #include "Common/CommonWindows.h" #else #include diff --git a/Core/HLE/sceRtc.cpp b/Core/HLE/sceRtc.cpp index 6fa90b8d74..cf903c9bb2 100644 --- a/Core/HLE/sceRtc.cpp +++ b/Core/HLE/sceRtc.cpp @@ -17,6 +17,7 @@ #ifdef _WIN32 #include "Common/CommonWindows.h" +#include #else #include #endif diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index e106adae5c..46e6aea09b 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -1493,8 +1493,6 @@ namespace MIPSInt PC += 4; } -#undef max - void Int_Vcst(u32 op) { int conNum = (op >> 16) & 0x1f; diff --git a/Core/System.cpp b/Core/System.cpp index f40c38e2d5..3258a7bc07 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -16,8 +16,6 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #ifdef _WIN32 -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN #include "Common/CommonWindows.h" #endif diff --git a/GPU/GLES/IndexGenerator.h b/GPU/GLES/IndexGenerator.h index 74faa7823e..832bc01a75 100644 --- a/GPU/GLES/IndexGenerator.h +++ b/GPU/GLES/IndexGenerator.h @@ -21,7 +21,6 @@ #include #include "CommonTypes.h" #include "../ge_constants.h" -#undef max class IndexGenerator { diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp index eb5385e5cf..3e3e5695bc 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManager.cpp @@ -20,7 +20,6 @@ #endif #ifdef SHADERLOG -#define WIN32_LEAN_AND_MEAN #include "Common/CommonWindows.h" #endif diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index 01403d6055..b3b6f6059e 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -20,12 +20,10 @@ #include "../../Core/Debugger/DebugInterface.h" -#include +#include "Common/CommonWindows.h" #include #include -#undef min -#undef max using std::min; using std::max; diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index 7f6fd0f378..1b24b1ef72 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -24,7 +24,7 @@ #include "Core/Config.h" #include "input/input_state.h" #include "base/NativeApp.h" -#include"input/keycodes.h" +#include "input/keycodes.h" #include "Core/Reporting.h" #include "Xinput.h" #pragma comment(lib,"dinput8.lib") diff --git a/Windows/OpenGLBase.h b/Windows/OpenGLBase.h index a946a16039..7b35d6f0d2 100644 --- a/Windows/OpenGLBase.h +++ b/Windows/OpenGLBase.h @@ -2,8 +2,7 @@ #pragma once -#define WIN32_LEAN_AND_MEAN -#include +#include "Common/CommonWindows.h" bool GL_Init(HWND window, std::string *error_message);