diff --git a/paddle/fluid/framework/io/shell.h b/paddle/fluid/framework/io/shell.h index 5b3e9a4df1d11b957d656181844f17a06574556f..dc486275d6f58eaa7a360b8f17830acd664b11c7 100644 --- a/paddle/fluid/framework/io/shell.h +++ b/paddle/fluid/framework/io/shell.h @@ -17,6 +17,9 @@ #include #include #ifdef _WIN32 +#ifndef NOMINMAX +#define NOMINMAX // msvc max/min macro conflict with std::min/max +#endif #include #else #include diff --git a/paddle/fluid/memory/detail/system_allocator.cc b/paddle/fluid/memory/detail/system_allocator.cc index c5b9d88433af9e6b620c14b297174473de9497ab..0fbbf405f0bf166b71a3b447338d9df7ad675f1b 100644 --- a/paddle/fluid/memory/detail/system_allocator.cc +++ b/paddle/fluid/memory/detail/system_allocator.cc @@ -17,6 +17,9 @@ limitations under the License. */ #ifdef _WIN32 #include +#ifndef NOMINMAX +#define NOMINMAX // msvc max/min macro conflict with std::min/max +#endif #include // VirtualLock/VirtualUnlock #else #include // for mlock and munlock diff --git a/paddle/fluid/operators/math/matrix_bit_code.h b/paddle/fluid/operators/math/matrix_bit_code.h index 7f507999fda0eb576d6d1da69da6c2e4d8a7459a..22e5256335c7399088480d4fbeb63952b1d1d663 100644 --- a/paddle/fluid/operators/math/matrix_bit_code.h +++ b/paddle/fluid/operators/math/matrix_bit_code.h @@ -27,6 +27,9 @@ limitations under the License. */ #if defined(_WIN32) #include +#ifndef NOMINMAX +#define NOMINMAX // msvc max/min macro conflict with std::min/max +#endif #include #endif // _WIN32 diff --git a/paddle/fluid/platform/cpu_info.cc b/paddle/fluid/platform/cpu_info.cc index 63760ada2b4d5226035b990cf5ecb7e1d21fbbe2..b86fd70c9aecddca7c1ce23085a46c5332d2e698 100644 --- a/paddle/fluid/platform/cpu_info.cc +++ b/paddle/fluid/platform/cpu_info.cc @@ -23,7 +23,9 @@ limitations under the License. */ #include #include #elif defined(_WIN32) +#ifndef NOMINMAX #define NOMINMAX // msvc max/min macro conflict with std::min/max +#endif #include #else #include diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 5d755d8c830c1c352da6587ca0707ef117b88a34..475256826f36086dae2eed1773829fae0e6db537 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -19,9 +19,11 @@ limitations under the License. */ #endif // __GNUC__ #if !defined(_WIN32) -#include // dladdr -#else // _WIN32 -#define NOMINMAX // msvc max/min macro conflict with std::min/max +#include // dladdr +#else // _WIN32 +#ifndef NOMINMAX +#define NOMINMAX // msvc max/min macro conflict with std::min/max +#endif #include // GetModuleFileName #endif