Bug 1014976 - Don't define _DEBUG on Windows debug builds, it's implied by -MDd/-MTd, and breaks builds with -MD/-MT. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 30 May 2014 09:39:53 +0900
changeset 204991 c43eac27b9593030df9f02794bc057ae0b5b3f52
parent 204990 ca0abd3d08bf96c066ffa3d4ba251dc0a82153a2
child 204992 c01b7a9531a9f76ce33fb1e31857cc112257477f
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1014976
milestone32.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 1014976 - Don't define _DEBUG on Windows debug builds, it's implied by -MDd/-MTd, and breaks builds with -MD/-MT. r=bsmedberg
build/autoconf/compiler-opts.m4
config/msvc-stl-wrapper.template.h
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -123,17 +123,17 @@ MOZ_ARG_ENABLE_STRING(debug,
   MOZ_DEBUG=)
 
 if test -z "$MOZ_DEBUG"; then
     MOZ_NO_DEBUG_RTL=1
 fi
 
 AC_SUBST(MOZ_NO_DEBUG_RTL)
 
-MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
+MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -DTRACING"
 MOZ_ARG_WITH_STRING(debug-label,
 [  --with-debug-label=LABELS
                           Define DEBUG_<value> for each comma-separated
                           value given.],
 [ for option in `echo $withval | sed 's/,/ /g'`; do
     MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
 done])
 
--- a/config/msvc-stl-wrapper.template.h
+++ b/config/msvc-stl-wrapper.template.h
@@ -31,23 +31,23 @@
 // code in nscore.h because nscore.h pulls in prtypes.h, and chromium
 // can't build with that being included before base/basictypes.h.
 #if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
 #  include "mozilla/mozalloc.h"
 #else
 #  error "STL code can only be used with infallible ::operator new()"
 #endif
 
-#ifdef DEBUG
+#ifdef _DEBUG
 // From
 //   http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx
 // and
 //   http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx
 // there appear to be two types of STL container checking.  The
-// former is enabled by -D_DEBUG (which is implied by -DDEBUG), and
+// former is enabled by -D_DEBUG (which is implied by -MDd or -MTd), and
 // looks to be full generation/mutation checked iterators as done by
 // _GLIBCXX_DEBUG.  The latter appears to just be bounds checking, and
 // is enabled by the following macros.  It appears that the _DEBUG
 // iterators subsume _SECURE_SCL, and the following settings are
 // default anyway, so we'll just leave this commented out.
 //#  define _SECURE_SCL 1
 //#  define _SECURE_SCL_THROWS 0
 #else