From 1a7de264ca5a8e5b11f16922051090406a1bf8dc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 31 Jan 2019 20:31:14 +0100 Subject: [PATCH] #4020 System : Define NOMINMAX before include of windows.h --- ApplicationCode/Application/Tools/RiaLogging.cpp | 4 ++++ Fwk/AppFwk/cafUserInterface/cafMemoryInspector.cpp | 4 ++++ Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/ApplicationCode/Application/Tools/RiaLogging.cpp b/ApplicationCode/Application/Tools/RiaLogging.cpp index 51f92c9b40..96c54d78be 100644 --- a/ApplicationCode/Application/Tools/RiaLogging.cpp +++ b/ApplicationCode/Application/Tools/RiaLogging.cpp @@ -23,6 +23,10 @@ #ifdef WIN32 #pragma warning (push) #pragma warning (disable: 4668) +// Define this one to tell windows.h to not define min() and max() as macros +#if defined WIN32 && !defined NOMINMAX +#define NOMINMAX +#endif #include #pragma warning (pop) #else diff --git a/Fwk/AppFwk/cafUserInterface/cafMemoryInspector.cpp b/Fwk/AppFwk/cafUserInterface/cafMemoryInspector.cpp index 8499376d50..b766d8666a 100644 --- a/Fwk/AppFwk/cafUserInterface/cafMemoryInspector.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafMemoryInspector.cpp @@ -6,6 +6,10 @@ #include #ifdef _WIN32 +// Define this one to tell windows.h to not define min() and max() as macros +#if defined WIN32 && !defined NOMINMAX +#define NOMINMAX +#endif #include "windows.h" #include "psapi.h" #elif defined (__linux__) diff --git a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp index 8cd8a121dd..2eb855f639 100644 --- a/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafProgressInfo.cpp @@ -369,6 +369,10 @@ namespace caf { #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable: 4668) + // Define this one to tell windows.h to not define min() and max() as macros + #if defined WIN32 && !defined NOMINMAX + #define NOMINMAX + #endif #include #pragma warning (pop) #endif