diff --git a/packages/profiling-node/binding.gyp b/packages/profiling-node/binding.gyp index fd2322db4e94..1c1aad075e39 100644 --- a/packages/profiling-node/binding.gyp +++ b/packages/profiling-node/binding.gyp @@ -6,5 +6,15 @@ # Silence gcc8 deprecation warning https://github.com/nodejs/nan/issues/807#issuecomment-455750192 "cflags": ["-Wno-cast-function-type"] }, - ] + ], + 'conditions': [ + [ 'OS=="win"', { + 'defines': [ + # Stop from defining macros that conflict with + # std::min() and std::max(). We don't use (much) + # but we still inherit it from uv.h. + 'NOMINMAX', + ] + }], + ], } diff --git a/packages/profiling-node/bindings/cpu_profiler.cc b/packages/profiling-node/bindings/cpu_profiler.cc index f269990f425b..64a82ba61910 100644 --- a/packages/profiling-node/bindings/cpu_profiler.cc +++ b/packages/profiling-node/bindings/cpu_profiler.cc @@ -1,3 +1,6 @@ +#ifndef NOMINMAX +#define NOMINMAX +#endif #include #include