diff --git a/mfbt/Atomics.h b/mfbt/Atomics.h index c7f76014276f..bf93f44f3bbd 100644 --- a/mfbt/Atomics.h +++ b/mfbt/Atomics.h @@ -42,14 +42,7 @@ # elif MOZ_USING_LIBCXX && defined(__clang__) # define MOZ_HAVE_CXX11_ATOMICS # endif -/* - * Although Visual Studio 2012's CRT supports , its atomic load - * implementation unnecessarily uses an atomic intrinsic for the less - * restrictive memory orderings, which can be prohibitively expensive. - * Therefore, we require at least Visual Studio 2013 for using the CRT - * (bug 1061764). - */ -#elif defined(_MSC_VER) && _MSC_VER >= 1800 +#elif defined(_MSC_VER) # if defined(DEBUG) /* * Provide our own failure code since we're having trouble linking to diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index 8b08d6078f15..d916d6a81ccf 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -50,18 +50,8 @@ * don't indicate support for them here, due to * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug */ -# if _MSC_VER >= 1800 -# define MOZ_HAVE_CXX11_DELETE -# endif -# if _MSC_VER >= 1700 -# define MOZ_HAVE_CXX11_FINAL final -# else -# if defined(__clang__) -# error Please do not try to use clang-cl with MSVC10 or below emulation! -# endif - /* MSVC <= 10 used to spell "final" as "sealed". */ -# define MOZ_HAVE_CXX11_FINAL sealed -# endif +# define MOZ_HAVE_CXX11_DELETE +# define MOZ_HAVE_CXX11_FINAL final # define MOZ_HAVE_CXX11_OVERRIDE # define MOZ_HAVE_NEVER_INLINE __declspec(noinline) # define MOZ_HAVE_NORETURN __declspec(noreturn) diff --git a/mfbt/Compiler.h b/mfbt/Compiler.h index 50f127da8623..290fe51a358b 100644 --- a/mfbt/Compiler.h +++ b/mfbt/Compiler.h @@ -31,19 +31,6 @@ # undef MOZ_IS_MSVC # define MOZ_IS_MSVC 1 - /* - * This macro should simplify MSVC version checking. For example, to check - * for VC10 or later, check `#ifdef MOZ_MSVC_VERSION_AT_LEAST(10)`. - */ -# define MOZ_MSVC_VERSION_AT_LEAST(version) \ - (version == 10 ? _MSC_VER >= 1600 : \ - (version == 11 ? _MSC_VER >= 1700 : \ - (version == 12 ? _MSC_VER >= 1800 : \ - (version == 13 ? _MSC_VER >= 1900 : \ - 0)))) -# if !MOZ_MSVC_VERSION_AT_LEAST(10) -# error "mfbt (and Gecko) require at least MSVC 2010 RTM to build." -# endif #endif diff --git a/mfbt/NullPtr.h b/mfbt/NullPtr.h index 5963613c4b3f..1d1355e13e33 100644 --- a/mfbt/NullPtr.h +++ b/mfbt/NullPtr.h @@ -25,7 +25,7 @@ # endif # endif #elif defined(_MSC_VER) - // The minimum supported MSVC (10, _MSC_VER 1600) supports nullptr. + // The minimum supported MSVC (12, _MSC_VER 1800) supports nullptr. # define MOZ_HAVE_CXX11_NULLPTR #endif diff --git a/mfbt/TypedEnumInternal.h b/mfbt/TypedEnumInternal.h index db7c1feabf3a..5af19e20202e 100644 --- a/mfbt/TypedEnumInternal.h +++ b/mfbt/TypedEnumInternal.h @@ -38,9 +38,7 @@ # endif #elif defined(_MSC_VER) # define MOZ_HAVE_CXX11_ENUM_TYPE -# if _MSC_VER >= 1700 -# define MOZ_HAVE_CXX11_STRONG_ENUMS -# endif +# define MOZ_HAVE_CXX11_STRONG_ENUMS #endif namespace mozilla { diff --git a/mfbt/tests/TestMaybe.cpp b/mfbt/tests/TestMaybe.cpp index 9e4fcb8e7003..0ee02734eca2 100644 --- a/mfbt/tests/TestMaybe.cpp +++ b/mfbt/tests/TestMaybe.cpp @@ -23,18 +23,13 @@ using mozilla::Swap; using mozilla::ToMaybe; using mozilla::UniquePtr; -// Work around a bug in Visual Studio 2010 and 2012 that prevents expressions of +#if MOZ_IS_MSVC + template struct Identity { typedef T type; }; +# define DECLTYPE(EXPR) Identity::type +#elif MOZ_IS_GCC +// Work around a bug in GCC < 4.7 that prevents expressions of // the form |decltype(foo)::type| from working. See here: // http://stackoverflow.com/questions/14330768/c11-compiler-error-when-using-decltypevar-followed-by-internal-type-of-var -// GCC < 4.7 also has a similar bug. -#if MOZ_IS_MSVC -# if MOZ_MSVC_VERSION_AT_LEAST(12) -# define DECLTYPE(EXPR) decltype(EXPR) -# else - template struct Identity { typedef T type; }; -# define DECLTYPE(EXPR) Identity::type -# endif -#elif MOZ_IS_GCC # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0) # define DECLTYPE(EXPR) decltype(EXPR) # else diff --git a/mfbt/tests/TestTypedEnum.cpp b/mfbt/tests/TestTypedEnum.cpp index 68813348f1ea..f08024325aeb 100644 --- a/mfbt/tests/TestTypedEnum.cpp +++ b/mfbt/tests/TestTypedEnum.cpp @@ -34,9 +34,7 @@ # endif # endif # elif defined(_MSC_VER) -# if _MSC_VER >= 1700 -# define MOZ_HAVE_IS_LITERAL -# endif +# define MOZ_HAVE_IS_LITERAL # endif #endif diff --git a/mfbt/tests/TestUniquePtr.cpp b/mfbt/tests/TestUniquePtr.cpp index d94de4fb369a..04f5c02dcbb5 100644 --- a/mfbt/tests/TestUniquePtr.cpp +++ b/mfbt/tests/TestUniquePtr.cpp @@ -330,24 +330,6 @@ TestReferenceDeleter() return true; } -// MSVC10 miscompiles mozilla::RemoveReference, claiming -// that the partial specializations RemoveReference and RemoveReference -// both match RemoveReference below. Thus in Mozilla code using -// UniquePtr with a function reference deleter is forbidden. But it doesn't -// hurt to run these tests when the compiler doesn't have problems with this, so -// do so for anything non-MSVC. -#if MOZ_IS_MSVC - // Technically this could be MOZ_MSVC_VERSION_AT_LEAST(11), but we're not - // going to support function deleters as long as we support MSVC10, so it - // hardly matters. In the meantime it's not worth the potential trouble (and - // potential for bustage) to run these tests on MSVC>=11. -# define SHOULD_TEST_FUNCTION_REFERENCE_DELETER 0 -#else -# define SHOULD_TEST_FUNCTION_REFERENCE_DELETER 1 -#endif - -#if SHOULD_TEST_FUNCTION_REFERENCE_DELETER - typedef void (&FreeSignature)(void*); static size_t DeleteIntFunctionCallCount = 0; @@ -400,8 +382,6 @@ TestFunctionReferenceDeleter() return true; } -#endif // SHOULD_TEST_FUNCTION_REFERENCE_DELETER - template::value> struct AppendNullptrTwice; @@ -597,11 +577,9 @@ main() if (!TestReferenceDeleter()) { return 1; } -#if SHOULD_TEST_FUNCTION_REFERENCE_DELETER if (!TestFunctionReferenceDeleter()) { return 1; } -#endif if (!TestVector()) { return 1; }