From ca8d4e3450b5a83a05b25e0c5046417d3360184b 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()`. Backport-PR-URL: https://github.com/nodejs/node/pull/22731 PR-URL: https://github.com/nodejs/node/pull/18216 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Joyee Cheung PR-URL: https://github.com/nodejs/node/pull/22731 --- node.gyp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node.gyp b/node.gyp index 1f9d34b200966c..cb0036629e21a1 100644 --- a/node.gyp +++ b/node.gyp @@ -446,6 +446,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' ]