summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce.palemoon@certner.fr>2021-01-18 13:37:10 +0100
committerOlivier Certner <olce.palemoon@certner.fr>2021-02-05 18:20:47 +0100
commit85bbf2c0598878a230ed54325263278ceb598d04 (patch)
tree8210e9b8579d9f9b413ae7bdccac066ffff87fe5
parentf84c6eb3ce9bd162c64b0f6417d9312855c3f97d (diff)
downloadaura-central-85bbf2c0598878a230ed54325263278ceb598d04.tar.gz
Issue mcp-graveyard/UXP%1729 - Support building/linking against libc++ 9+
Including <cstdlib> must never trigger inclusion of "mozalloc.h", because the first thing this one does is precisely to include <cstdlib>. It is now the case that, in libc++ 9 and beyond, <cstdlib> includes <math.h> which then tries to include <type_traits>, which the STL wrapper intercepts, trying to load "mozalloc.h". Same problem happens with <limits>. Fix pulled from: https://bugzilla.mozilla.org/show_bug.cgi?id=1594027.
-rw-r--r--config/gcc-stl-wrapper.template.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/config/gcc-stl-wrapper.template.h b/config/gcc-stl-wrapper.template.h
index 9b4a61d24..e7b01482c 100644
--- a/config/gcc-stl-wrapper.template.h
+++ b/config/gcc-stl-wrapper.template.h
@@ -32,6 +32,14 @@
# define moz_dont_include_mozalloc_for_cstdlib
#endif
+#ifndef moz_dont_include_mozalloc_for_type_traits
+# define moz_dont_include_mozalloc_for_type_traits
+#endif
+
+#ifndef moz_dont_include_mozalloc_for_limits
+# define moz_dont_include_mozalloc_for_limits
+#endif
+
// Include mozalloc after the STL header and all other headers it includes
// have been preprocessed.
#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \