未验证 提交 e5bbffa8 编写于 作者: J joanna.wozna.intel 提交者: GitHub

Add NOMINMAX define due to windows.h max/min macro conflict (#25637)

test=develop
上级 70cee22f
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef _WIN32 #ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h> #include <windows.h>
#else #else
#include <sys/syscall.h> #include <sys/syscall.h>
......
...@@ -17,6 +17,9 @@ limitations under the License. */ ...@@ -17,6 +17,9 @@ limitations under the License. */
#ifdef _WIN32 #ifdef _WIN32
#include <malloc.h> #include <malloc.h>
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h> // VirtualLock/VirtualUnlock #include <windows.h> // VirtualLock/VirtualUnlock
#else #else
#include <sys/mman.h> // for mlock and munlock #include <sys/mman.h> // for mlock and munlock
......
...@@ -27,6 +27,9 @@ limitations under the License. */ ...@@ -27,6 +27,9 @@ limitations under the License. */
#if defined(_WIN32) #if defined(_WIN32)
#include <intrin.h> #include <intrin.h>
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h> #include <windows.h>
#endif // _WIN32 #endif // _WIN32
......
...@@ -23,7 +23,9 @@ limitations under the License. */ ...@@ -23,7 +23,9 @@ limitations under the License. */
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/types.h> #include <sys/types.h>
#elif defined(_WIN32) #elif defined(_WIN32)
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max #define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h> #include <windows.h>
#else #else
#include <unistd.h> #include <unistd.h>
......
...@@ -21,7 +21,9 @@ limitations under the License. */ ...@@ -21,7 +21,9 @@ limitations under the License. */
#if !defined(_WIN32) #if !defined(_WIN32)
#include <dlfcn.h> // dladdr #include <dlfcn.h> // dladdr
#else // _WIN32 #else // _WIN32
#ifndef NOMINMAX
#define NOMINMAX // msvc max/min macro conflict with std::min/max #define NOMINMAX // msvc max/min macro conflict with std::min/max
#endif
#include <windows.h> // GetModuleFileName #include <windows.h> // GetModuleFileName
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册