diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-09-03 23:03:25 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-09-03 23:03:25 +0000 |
commit | 7f2aae99374591badceb805a7cc9b2d17ceecc96 (patch) | |
tree | e5402c68269882a9fc33595621226264f5179db5 | |
parent | c91c1a205a287bcd6dbea574e08cc0351fbfe9f7 (diff) | |
download | llvm-7f2aae99374591badceb805a7cc9b2d17ceecc96.zip llvm-7f2aae99374591badceb805a7cc9b2d17ceecc96.tar.gz llvm-7f2aae99374591badceb805a7cc9b2d17ceecc96.tar.bz2 |
Configure libc++ to recognize and use inline namespaces for clang. Many, many thanks to Sebastian Redl for implementing it in clang, and to Daniel Dunbar for rattling my cage about it. This is huge for libc++. Thanks to you both\!
llvm-svn: 113026
-rw-r--r-- | libcxx/include/__config | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 2bba0e9..9511ee1 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -95,9 +95,24 @@ #endif #define _LIBCPP_HAS_NO_ADVANCED_SFINAE -#define _LIBCPP_HAS_NO_STRONG_USING #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES +#if __has_feature(cxx_inline_namespaces) +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { +#define _LIBCPP_END_NAMESPACE_STD } } +#define _STD std::_LIBCPP_NAMESPACE + +namespace std { +inline namespace _LIBCPP_NAMESPACE { +} +using namespace _LIBCPP_NAMESPACE; +} +#else // __has_feature(cxx_inline_namespaces) +#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { +#define _LIBCPP_END_NAMESPACE_STD } +#define _STD std +#endif // __has_feature(cxx_inline_namespaces) + #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define _LIBCPP_HAS_NO_DECLTYPE @@ -181,13 +196,6 @@ #endif // __GXX_EXPERIMENTAL_CXX0X__ -#endif // defined(__GNUC__) - -#ifdef _LIBCPP_HAS_NO_STRONG_USING -#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { -#define _LIBCPP_END_NAMESPACE_STD } -#define _STD std -#else // _LIBCPP_HAS_NO_STRONG_USING #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE { #define _LIBCPP_END_NAMESPACE_STD } } #define _STD std::_LIBCPP_NAMESPACE @@ -198,7 +206,7 @@ namespace _LIBCPP_NAMESPACE { using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); } -#endif // _LIBCPP_HAS_NO_STRONG_USING +#endif // defined(__GNUC__) #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS typedef unsigned short char16_t; |