Author: hhinnant
Date: Fri Sep 3 18:03:25 2010
New Revision: 113026
URL: http://llvm.org/viewvc/llvm-project?rev=113026&view=rev
Log:
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\!
Modified:
libcxx/trunk/include/__config
Modified: libcxx/trunk/include/__config
URL:
http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=113026&r1=113025&r2=113026&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Fri Sep 3 18:03:25 2010
@@ -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 @@
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;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits