Bug 1229587 part 2 - Use verbose format to disable C4061 to workaround bug of VS2015u1. r=keeler
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 03 Dec 2015 09:29:42 +1100
changeset 309476 177b0d0529e9fe4c206bd9f9e1d857e765ba8377
parent 309475 d274136019db1c59cb3d4d8464b3ac4e6ac4ecbc
child 309477 dee213acd662a8e9f3535d4bbefd34102d9efc1e
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1229587
milestone45.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 1229587 part 2 - Use verbose format to disable C4061 to workaround bug of VS2015u1. r=keeler
security/manager/ssl/ScopedNSSTypes.h
--- a/security/manager/ssl/ScopedNSSTypes.h
+++ b/security/manager/ssl/ScopedNSSTypes.h
@@ -62,24 +62,16 @@ MapSECStatus(SECStatus rv)
 {
   if (rv == SECSuccess) {
     return NS_OK;
   }
 
   return mozilla::psm::GetXPCOMFromNSSError(PR_GetError());
 }
 
-#ifdef _MSC_VER
-// C4061: enumerator 'symbol' in switch of enum 'symbol' is not explicitly
-// handled.
-#define MOZ_NON_EXHAUSTIVE_SWITCH __pragma(warning(suppress:4061)) switch
-#else
-#define MOZ_NON_EXHAUSTIVE_SWITCH switch
-#endif
-
 // Alphabetical order by NSS type
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc,
                                           PRFileDesc,
                                           PR_Close)
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCERTCertificate,
                                           CERTCertificate,
                                           CERT_DestroyCertificate)
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedCERTCertificateList,
@@ -203,25 +195,34 @@ public:
     return NS_OK;
   }
 
   const SECItem & get() const { return item; }
 
 private:
   nsresult SetLength(SECOidTag hashType)
   {
-    MOZ_NON_EXHAUSTIVE_SWITCH (hashType)
+#ifdef _MSC_VER
+#pragma warning(push)
+    // C4061: enumerator 'symbol' in switch of enum 'symbol' is not
+    // explicitly handled.
+#pragma warning(disable:4061)
+#endif
+    switch (hashType)
     {
       case SEC_OID_SHA1:   item.len = SHA1_LENGTH;   break;
       case SEC_OID_SHA256: item.len = SHA256_LENGTH; break;
       case SEC_OID_SHA384: item.len = SHA384_LENGTH; break;
       case SEC_OID_SHA512: item.len = SHA512_LENGTH; break;
       default:
         return NS_ERROR_INVALID_ARG;
     }
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 
     return NS_OK;
   }
 
   uint8_t buf[HASH_LENGTH_MAX];
   SECItem item;
 };