diff --git a/graphbolt/CMakeLists.txt b/graphbolt/CMakeLists.txt index e3819990a3..8ffbc2a5cf 100644 --- a/graphbolt/CMakeLists.txt +++ b/graphbolt/CMakeLists.txt @@ -8,6 +8,11 @@ if(USE_CUDA) add_definitions(-DGRAPHBOLT_USE_CUDA) 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 # $PYTHON_INTERP ("python3" or "python" if empty) if(NOT PYTHON_INTERP) diff --git a/graphbolt/include/graphbolt/shared_memory.h b/graphbolt/include/graphbolt/shared_memory.h index c8ecdd4f44..266afea492 100644 --- a/graphbolt/include/graphbolt/shared_memory.h +++ b/graphbolt/include/graphbolt/shared_memory.h @@ -8,21 +8,12 @@ #define GRAPHBOLT_SHARED_MEMORY_H_ #ifdef _WIN32 -// Add the macro to avoid MIN/MAX conflict. -#ifndef NOMINMAX -#define NOMINMAX -#define GRAPHBOLT_WINDOWS_NOMINMAX_ -#endif // NOMINMAX #include #endif // _WIN32 #include #include -#ifdef GRAPHBOLT_WINDOWS_NOMINMAX_ -#undef NOMINMAX -#endif // GRAPHBOLT_WINDOWS_NOMINMAX_ - namespace graphbolt { namespace sampling {