commit 87d5db057b53fc643ac0c316653a46ada54b3c91 (tree)
parent 92b69215e63a3303a5e904ab332e2eec236e0ed2
Author: Andrew Kelley <andrew@ziglang.org>
Date: Wed, 18 Aug 2021 15:27:00 -0700
update libcxx to latest llvm release/13.x
rc1 + 98feb20df14e6cf9ce77f097ceb8dd188c9070a7
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/libcxx/include/__config b/lib/libcxx/include/__config
@@ -352,6 +352,16 @@
# define _LIBCPP_NO_CFI
#endif
+// If the compiler supports using_if_exists, pretend we have those functions and they'll
+// be picked up if the C library provides them.
+//
+// TODO: Once we drop support for Clang 12, we can assume the compiler supports using_if_exists
+// for platforms that don't have a conforming C11 library, so we can drop this whole thing.
+#if __has_attribute(using_if_exists)
+# define _LIBCPP_HAS_TIMESPEC_GET
+# define _LIBCPP_HAS_QUICK_EXIT
+# define _LIBCPP_HAS_ALIGNED_ALLOC
+#else
#if (defined(__ISO_C_VISIBLE) && (__ISO_C_VISIBLE >= 2011)) || __cplusplus >= 201103L
# if defined(__FreeBSD__)
# define _LIBCPP_HAS_ALIGNED_ALLOC
@@ -406,6 +416,7 @@
# endif
# endif // __APPLE__
#endif
+#endif // __has_attribute(using_if_exists)
#ifndef _LIBCPP_CXX03_LANG
# define _LIBCPP_ALIGNOF(_Tp) alignof(_Tp)
diff --git a/lib/libcxx/include/ctime b/lib/libcxx/include/ctime
@@ -59,7 +59,7 @@ int timespec_get( struct timespec *ts, int base); // C++17
// we're detecting this here instead of in <__config> because we can't include
// system headers from <__config>, since it leads to circular module dependencies.
// This is also meant to be a very temporary workaround until the SDKs are fixed.
-#if defined(__APPLE__)
+#if defined(__APPLE__) && !__has_attribute(using_if_exists)
# include <sys/cdefs.h>
# if defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
# define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED