Skip to content

Commit 2a92d0f

Browse files
bnoordhuisMayaLekova
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()`. PR-URL: nodejs#18216 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 5bcc1c7 commit 2a92d0f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

node.gyp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,10 @@
452452
'FD_SETSIZE=1024',
453453
# we need to use node's preferred "win32" rather than gyp's preferred "win"
454454
'NODE_PLATFORM="win32"',
455+
# Stop <windows.h> from defining macros that conflict with
456+
# std::min() and std::max(). We don't use <windows.h> (much)
457+
# but we still inherit it from uv.h.
458+
'NOMINMAX',
455459
'_UNICODE=1',
456460
],
457461
'libraries': [ '-lpsapi.lib' ]

0 commit comments

Comments
 (0)