Skip to content

Commit 603e93d

Browse files
authored
fix(profiling): override win macros (#11860)
1 parent 636a1cb commit 603e93d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/profiling-node/binding.gyp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@
66
# Silence gcc8 deprecation warning https://github.com/nodejs/nan/issues/807#issuecomment-455750192
77
"cflags": ["-Wno-cast-function-type"]
88
},
9-
]
9+
],
10+
'conditions': [
11+
[ 'OS=="win"', {
12+
'defines': [
13+
# Stop <windows.h> from defining macros that conflict with
14+
# std::min() and std::max(). We don't use <windows.h> (much)
15+
# but we still inherit it from uv.h.
16+
'NOMINMAX',
17+
]
18+
}],
19+
],
1020
}

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef NOMINMAX
2+
#define NOMINMAX
3+
#endif
14

25
#include <assert.h>
36
#include <math.h>

0 commit comments

Comments
 (0)