blob: c5b861c2d09b08a01d1ff380160006ac37f0c6d7 [file] [log] [blame]
Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1245076
--- a/config/gcc-stl-wrapper.template.h 2016-08-31 12:38:43.094770023 -0400
+++ b/config/gcc-stl-wrapper.template.h 2016-08-31 12:40:12.030579071 -0400
@@ -17,6 +17,12 @@
// Silence "warning: #include_next is a GCC extension"
#pragma GCC system_header
+
+#ifndef moz_dont_include_mozalloc_for_cstdlib
+# define moz_dont_include_mozalloc_for_cstdlib
+#endif
+#ifndef moz_dont_include_mozalloc_for_${HEADER}
+
// mozalloc.h wants <new>; break the cycle by always explicitly
// including <new> here. NB: this is a tad sneaky. Sez the gcc docs:
//
@@ -25,15 +31,17 @@
// same name as the current file. It simply looks for the file
// named, starting with the directory in the search path after the
// one where the current file was found.
-#include_next <new>
+# include_next <new>
// See if we're in code that can use mozalloc. NB: this duplicates
// 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()"
+# 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
+
#endif
#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)