From 59e05349ae7f88d1891e454914a7a2d7ac01023d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Aug 2017 16:37:47 +0200 Subject: Work around issue with exporting internal linkage names in libstdc++ See Clang bug 33910 for details. --- std-core.mxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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() // libstdc++ __GLIBCXX__ +# include +# endif +#elif defined(__GNUC__) +# include // libstdc++ __GLIBCXX__ +#endif + +#if defined(_MSC_VER) +#elif defined(__GLIBCXX__) +# include // Names with internal linkage. +#elif defined(_LIBCPP_VERSION) +#else +# error unknown standard library implementation +#endif + export module std.core; export -- cgit v1.1