From 09fe6fe153db99ad78ba72cf01aab6829a39c80b Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 8 Jan 2015 12:47:00 +0100 Subject: [PATCH] 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: https://github.com/iojs/io.js/pull/261 Reviewed-By: Ben Noordhuis --- src/node_os.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_os.cc b/src/node_os.cc index a63f77b1e5..9017c6ff2c 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -111,6 +111,9 @@ static void GetOSRelease(const FunctionCallbackInfo& args) { OSVERSIONINFOW info; info.dwOSVersionInfoSize = sizeof(info); + + // Don't complain that GetVersionEx is deprecated; there is no alternative. + #pragma warning(suppress : 4996) if (GetVersionExW(&info) == 0) return;