Bug 1211306 - Replace a use of deprecated GetVersionEx() with its MFBT equivalent. r=jduell.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 04 Oct 2015 19:11:29 -0700
changeset 266183 a8e67d912ab6d0828b34ddbb96872f51706fb241
parent 266182 b13aac696f7d4963bbe8fbd7401130ab55adb5b2
child 266184 46649f1cb2ef49ab5e34b720e4ba0f0850576b64
push id29483
push usercbook@mozilla.com
push dateTue, 06 Oct 2015 10:01:59 +0000
treeherdermozilla-central@89732fcdb0ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs1211306
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1211306 - Replace a use of deprecated GetVersionEx() with its MFBT equivalent. r=jduell.
netwerk/test/TestUDPSocket.cpp
--- a/netwerk/test/TestUDPSocket.cpp
+++ b/netwerk/test/TestUDPSocket.cpp
@@ -8,16 +8,17 @@
 #include "nsISocketTransportService.h"
 #include "nsISocketTransport.h"
 #include "nsIOutputStream.h"
 #include "nsIInputStream.h"
 #include "nsINetAddr.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsITimer.h"
 #include "mozilla/net/DNS.h"
+#include "mozilla/WindowsVersion.h"
 #include "prerror.h"
 
 #define REQUEST  0x68656c6f
 #define RESPONSE 0x6f6c6568
 #define MULTICAST_TIMEOUT 2000
 
 #define EXPECT_SUCCESS(rv, ...) \
   PR_BEGIN_MACRO \
@@ -333,26 +334,21 @@ main(int32_t argc, char *argv[])
   // Setup timer to detect multicast failure
   nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
   if (NS_WARN_IF(!timer)) {
     return -1;
   }
   nsRefPtr<MulticastTimerCallback> timerCb = new MulticastTimerCallback();
 
   // The following multicast tests using multiple sockets require a firewall
-  // exception on Windows XP before they pass.  For now, we'll skip them here.
-  // Later versions of Windows don't seem to have this issue.
+  // exception on Windows XP (the earliest version of Windows we now support)
+  // before they pass. For now, we'll skip them here. Later versions of Windows
+  // (Win2003 and onward) don't seem to have this issue.
 #ifdef XP_WIN
-  OSVERSIONINFO OsVersion;
-  OsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-#pragma warning(push)
-#pragma warning(disable:4996) // 'GetVersionExA': was declared deprecated
-  GetVersionEx(&OsVersion);
-#pragma warning(pop)
-  if (OsVersion.dwMajorVersion == 5 && OsVersion.dwMinorVersion == 1) {
+  if (!mozilla::IsWin2003OrLater()) {   // i.e. if it is WinXP
     goto close;
   }
 #endif
 
   // Join multicast group
   printf("Joining multicast group\n");
   phase = TEST_MULTICAST;
   mozilla::net::NetAddr multicastAddr;