Bug 712936 - Convert users of PR_STATIC_ASSERT to C++11 static_assert(). r=Ms2ger
authorJinank Jain <jinank94@gmail.com>
Fri, 26 Aug 2016 11:40:16 -0400
changeset 312025 0d5e83f29513b04d5899bfd10d9dd0c2b7311b5a
parent 312024 43cb9ff43f567ee8f132d42ee3d57a64110eb38a
child 312026 c266914d349a53ffb383398f884a82904a1c7375
push id81259
push userryanvm@gmail.com
push dateWed, 31 Aug 2016 14:20:46 +0000
treeherdermozilla-inbound@bccb467cbc4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs712936
milestone51.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 712936 - Convert users of PR_STATIC_ASSERT to C++11 static_assert(). r=Ms2ger
netwerk/base/nsSocketTransportService2.cpp
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -1398,17 +1398,17 @@ nsSocketTransportService::ProbeMaxCount(
             else
                 gMaxCount = index;
             break;
         }
         ++numAllocated;
     }
 
     // Test
-    PR_STATIC_ASSERT(SOCKET_LIMIT_MIN >= 32U);
+    static_assert(SOCKET_LIMIT_MIN >= 32U, "Minimum Socket Limit is >= 32");
     while (gMaxCount <= numAllocated) {
         int32_t rv = PR_Poll(pfd, gMaxCount, PR_MillisecondsToInterval(0));
         
         SOCKET_LOG(("Socket Limit Test poll() size=%d rv=%d\n",
                     gMaxCount, rv));
 
         if (rv >= 0)
             break;
@@ -1467,17 +1467,17 @@ nsSocketTransportService::DiscoverMaxCou
     setrlimit(RLIMIT_NOFILE, &rlimitData);
     if ((getrlimit(RLIMIT_NOFILE, &rlimitData) != -1) &&
         (rlimitData.rlim_cur > SOCKET_LIMIT_MIN)) {
         gMaxCount = rlimitData.rlim_cur;
     }
 
 #elif defined(XP_WIN) && !defined(WIN_CE)
     // >= XP is confirmed to have at least 1000
-    PR_STATIC_ASSERT(SOCKET_LIMIT_TARGET <= 1000);
+    static_assert(SOCKET_LIMIT_TARGET <= 1000, "SOCKET_LIMIT_TARGET max value is 1000");
     gMaxCount = SOCKET_LIMIT_TARGET;
 #else
     // other platforms are harder to test - so leave at safe legacy value
 #endif
 
     return PR_SUCCESS;
 }