Bug 1115903, Remove VS2010 workarounds, r=mmc
authorBrian Smith <brian@briansmith.org>
Fri, 26 Dec 2014 21:39:54 -0800
changeset 247629 f94b6b45ec2a5f1ecef0b9be072183716a539193
parent 247628 a74c3b9e50c45050c7abf5a97be3a00188d65175
child 247630 ca3c73188295f95fffa41af4096940ecfadae121
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmmc
bugs1115903
milestone37.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 1115903, Remove VS2010 workarounds, r=mmc
security/pkix/include/pkix/enumclass.h
security/pkix/lib/pkixder.h
security/pkix/moz.build
security/pkix/test/lib/pkixtestnss.cpp
--- a/security/pkix/include/pkix/enumclass.h
+++ b/security/pkix/include/pkix/enumclass.h
@@ -20,23 +20,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #ifndef mozilla_pkix__enumclass_h
 #define mozilla_pkix__enumclass_h
 
-#if defined(_MSC_VER) && (_MSC_VER < 1700)
-// Microsoft added support for "enum class" in Visual C++ 2012. Before that,
-// Visual C++ has supported typed enums for longer than that, but using typed
-// enums results in C4480: nonstandard extension used: specifying underlying
-// type for enum.
-#define MOZILLA_PKIX_ENUM_CLASS  __pragma(warning(suppress: 4480)) enum
-#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407)
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 407)
 // GCC before version 4.7 may crash when compiling code that static_casts a
 // value of scoped typed enum type. See
 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48106.
 #define MOZILLA_PKIX_ENUM_CLASS enum
 #else
 #define MOZILLA_PKIX_ENUM_CLASS enum class
 #define MOZILLA_PKIX_ENUM_CLASS_REALLY_IS_ENUM_CLASS
 #endif
--- a/security/pkix/lib/pkixder.h
+++ b/security/pkix/lib/pkixder.h
@@ -161,19 +161,16 @@ Nested(Reader& input, uint8_t tag, Decod
   }
   return End(nested);
 }
 
 template <typename Decoder>
 inline Result
 Nested(Reader& input, uint8_t outerTag, uint8_t innerTag, Decoder decoder)
 {
-  // XXX: This doesn't work (in VS2010):
-  // return Nested(input, outerTag, bind(Nested, _1, innerTag, decoder));
-
   Reader nestedInput;
   Result rv = ExpectTagAndGetValue(input, outerTag, nestedInput);
   if (rv != Success) {
     return rv;
   }
   rv = Nested(nestedInput, innerTag, decoder);
   if (rv != Success) {
     return rv;
--- a/security/pkix/moz.build
+++ b/security/pkix/moz.build
@@ -25,18 +25,16 @@ TEST_DIRS += [
     'test/gtest',
     'test/lib',
 ]
 
 CXXFLAGS += ['-Wall']
 # -Wall with Visual C++ enables too many problematic warnings
 if CONFIG['_MSC_VER']:
   CXXFLAGS += [
-    '-wd4480', # nonstandard extension used: specifying underlying type for
-               # enum 'enum'
     '-wd4514', # 'function': unreferenced inline function has been removed
     '-wd4668', # 'symbol' is not defined as a preprocessor macro...
     '-wd4710', # 'function': function not inlined
     '-wd4711', # function 'function' selected for inline expansion
     '-wd4820', # 'bytes' bytes padding added after construct 'member_name'
   ]
 
 FAIL_ON_WARNINGS = True
--- a/security/pkix/test/lib/pkixtestnss.cpp
+++ b/security/pkix/test/lib/pkixtestnss.cpp
@@ -208,23 +208,16 @@ GenerateKeyPairInner()
     static const uint8_t RANDOM_NUMBER[] = { 4, 4, 4, 4, 4, 4, 4, 4 };
     if (PK11_RandomUpdate((void*) &RANDOM_NUMBER,
                           sizeof(RANDOM_NUMBER)) != SECSuccess) {
       break;
     }
   }
 
   abort();
-#if defined(_MSC_VER) && (_MSC_VER < 1700)
-  // Older versions of MSVC don't know that abort() never returns, so silence
-  // its warning by adding a redundant and never-reached return. But, only do
-  // it for that ancient compiler, because some other compilers will rightly
-  // warn that the return statement is unreachable.
-  return nullptr;
-#endif
 }
 
 } // unnamed namespace
 
 TestKeyPair*
 GenerateKeyPair()
 {
   InitNSSIfNeeded();