win: suppress GetVersionEx deprecation warning
authorBert Belder <bertbelder@gmail.com>
Thu, 8 Jan 2015 11:47:00 +0000 (12:47 +0100)
committerBert Belder <bertbelder@gmail.com>
Thu, 8 Jan 2015 13:17:23 +0000 (14:17 +0100)
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 <info@bnoordhuis.nl>
src/node_os.cc

index a63f77b..9017c6f 100644 (file)
@@ -111,6 +111,9 @@ static void GetOSRelease(const FunctionCallbackInfo<Value>& 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;