Bug 1423649 - Fix compiler errors that happen when building with VS2017 15.5. r=rillian
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 08 Dec 2017 10:40:08 -0500
changeset 447558 b29d4a64f58995732e07dc984bf90247da6324aa
parent 447557 58ab683a6b02a6692204a797fc5c8ddaf101ba56
child 447559 d57b532c6cd0333711f30239925ca116747914f6
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1423649
milestone59.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 1423649 - Fix compiler errors that happen when building with VS2017 15.5. r=rillian
memory/mozalloc/mozalloc.h
old-configure.in
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -125,17 +125,21 @@ MOZ_END_EXTERN_C
 #else
 #  define MOZALLOC_EXPORT_NEW
 #endif
 
 #if defined(_MSC_VER)
 /*
  * Suppress build warning spam (bug 578546).
  */
+#if _MSC_VER < 1912
 #define MOZALLOC_THROW_IF_HAS_EXCEPTIONS
+#else
+#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS throw()
+#endif
 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
 #elif __cplusplus >= 201103
 /*
  * C++11 has deprecated exception-specifications in favour of |noexcept|.
  */
 #define MOZALLOC_THROW_IF_HAS_EXCEPTIONS noexcept(true)
 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS noexcept(false)
 #else
--- a/old-configure.in
+++ b/old-configure.in
@@ -1034,16 +1034,18 @@ case "$target" in
             CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"
             # jemalloc uses __declspec(allocator) as a profiler hint,
             # which clang-cl doesn't understand.
             CXXFLAGS="$CXXFLAGS -Wno-ignored-attributes"
         fi
         # make 'foo == bar;' error out
         CFLAGS="$CFLAGS -we4553"
         CXXFLAGS="$CXXFLAGS -we4553"
+        # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
+        CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
         LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
         MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
         WARNINGS_AS_ERRORS='-WX'
         MOZ_OPTIMIZE_FLAGS='-O1 -Oi'
         MOZ_FIX_LINK_PATHS=
         LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
         if test -z "$DEVELOPER_OPTIONS"; then
             LDFLAGS="$LDFLAGS -RELEASE"