Skip to content

Commit 09fe6fe

Browse files
committed
win: suppress GetVersionEx deprecation warning
There is no other way to retrieve the Windows version. The stated reason this API is deprecated is that applications are not supposed to check whether the Windows it's running on is recent enough. But that's not what we use it for. PR-URL: nodejs#261 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 0ce7b91 commit 09fe6fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/node_os.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ static void GetOSRelease(const FunctionCallbackInfo<Value>& args) {
111111
OSVERSIONINFOW info;
112112

113113
info.dwOSVersionInfoSize = sizeof(info);
114+
115+
// Don't complain that GetVersionEx is deprecated; there is no alternative.
116+
#pragma warning(suppress : 4996)
114117
if (GetVersionExW(&info) == 0)
115118
return;
116119

0 commit comments

Comments
 (0)