"git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "fcd8ed9acc73fd879effc8b434234e48efed722a"
Unverified Commit a2cb2ecd authored by peizhou001's avatar peizhou001 Committed by GitHub
Browse files

[Graphbolt]Fix windows nominmax issue (#6853)


Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-21-218.ap-northeast-1.compute.internal>
parent 5b51e968
...@@ -8,6 +8,11 @@ if(USE_CUDA) ...@@ -8,6 +8,11 @@ if(USE_CUDA)
add_definitions(-DGRAPHBOLT_USE_CUDA) add_definitions(-DGRAPHBOLT_USE_CUDA)
endif() endif()
# For windows, define NOMINMAX to avoid conflict with std::min/max
if(MSVC)
add_definitions(-DNOMINMAX)
endif()
# Find PyTorch cmake files and PyTorch versions with the python interpreter # Find PyTorch cmake files and PyTorch versions with the python interpreter
# $PYTHON_INTERP ("python3" or "python" if empty) # $PYTHON_INTERP ("python3" or "python" if empty)
if(NOT PYTHON_INTERP) if(NOT PYTHON_INTERP)
......
...@@ -8,21 +8,12 @@ ...@@ -8,21 +8,12 @@
#define GRAPHBOLT_SHARED_MEMORY_H_ #define GRAPHBOLT_SHARED_MEMORY_H_
#ifdef _WIN32 #ifdef _WIN32
// Add the macro to avoid MIN/MAX conflict.
#ifndef NOMINMAX
#define NOMINMAX
#define GRAPHBOLT_WINDOWS_NOMINMAX_
#endif // NOMINMAX
#include <windows.h> #include <windows.h>
#endif // _WIN32 #endif // _WIN32
#include <memory> #include <memory>
#include <string> #include <string>
#ifdef GRAPHBOLT_WINDOWS_NOMINMAX_
#undef NOMINMAX
#endif // GRAPHBOLT_WINDOWS_NOMINMAX_
namespace graphbolt { namespace graphbolt {
namespace sampling { namespace sampling {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment