Skip to content

Commit ca8d4e3

Browse files
bnoordhuisBethGriggs
authored andcommitted
build: define NOMINMAX on windows
Build with `-DNOMINMAX` to stop `<windows.h>` from defining macros that conflict with `std::min()` and `std::max()`. Backport-PR-URL: #22731 PR-URL: #18216 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> PR-URL: #22731
1 parent 48f31bd commit ca8d4e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

node.gyp

+4
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@
446446
'FD_SETSIZE=1024',
447447
# we need to use node's preferred "win32" rather than gyp's preferred "win"
448448
'NODE_PLATFORM="win32"',
449+
# Stop <windows.h> from defining macros that conflict with
450+
# std::min() and std::max(). We don't use <windows.h> (much)
451+
# but we still inherit it from uv.h.
452+
'NOMINMAX',
449453
'_UNICODE=1',
450454
],
451455
'libraries': [ '-lpsapi.lib' ]

0 commit comments

Comments
 (0)