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
commitf3405dbede811b21918776034dbb47a5d5e780c4 (patch)
tree8210e9b8579d9f9b413ae7bdccac066ffff87fe5
parent66d028942c3246f17f3f86ce40c230041556d27d (diff)
downloaduxp-f3405dbede811b21918776034dbb47a5d5e780c4.tar.gz
Issue #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 9b4a61d246..e7b01482c2 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) && \