aboutsummaryrefslogtreecommitdiff
path: root/std-core.mxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-22 16:37:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-22 16:37:47 +0200
commit59e05349ae7f88d1891e454914a7a2d7ac01023d (patch)
tree5323444230786bb9f1d5cc7373d46b57fecc886a /std-core.mxx
parent8b0dc4491d615d0c46af62f8699270caaeb196c5 (diff)
Work around issue with exporting internal linkage names in libstdc++
See Clang bug 33910 for details.
Diffstat (limited to 'std-core.mxx')
-rw-r--r--std-core.mxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/std-core.mxx b/std-core.mxx
index 6ee4a9e..3aba712 100644
--- a/std-core.mxx
+++ b/std-core.mxx
@@ -2,6 +2,28 @@
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
+// For some standard library implementations we need to pre-include certain
+// headers to prevent their exporting. And to detect a standard library we
+// need to include a certain header first.
+//
+#if defined(__clang__)
+# if __has_include(<__config>) // libc++ _LIBCPP_VERSION
+# include <__config>
+# elif __has_include(<bits/c++config.h>) // libstdc++ __GLIBCXX__
+# include <bits/c++config.h>
+# endif
+#elif defined(__GNUC__)
+# include <bits/c++config.h> // libstdc++ __GLIBCXX__
+#endif
+
+#if defined(_MSC_VER)
+#elif defined(__GLIBCXX__)
+# include <ext/atomicity.h> // Names with internal linkage.
+#elif defined(_LIBCPP_VERSION)
+#else
+# error unknown standard library implementation
+#endif
+
export module std.core;
export