From 0b1841d83f58caa507f602144a6b7cec831f3235 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 23 Jan 2018 01:17:21 +0100 Subject: [PATCH] build: define NOMINMAX on windows Build with `-DNOMINMAX` to stop `` from defining macros that conflict with `std::min()` and `std::max()`. PR-URL: https://github.com/nodejs/node/pull/18216 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- node.gyp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node.gyp b/node.gyp index 54bdb87669..ddb8e4c15f 100644 --- a/node.gyp +++ b/node.gyp @@ -452,6 +452,10 @@ 'FD_SETSIZE=1024', # we need to use node's preferred "win32" rather than gyp's preferred "win" 'NODE_PLATFORM="win32"', + # 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', '_UNICODE=1', ], 'libraries': [ '-lpsapi.lib' ]