[libcxx-commits] [libcxx] fda3825 - [libc++] Ensure __config always defines certain configuration macros.
Eric Fiselier via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 13 12:43:47 PST 2019
Author: Eric Fiselier
Date: 2019-12-13T15:42:07-05:00
New Revision: fda3825c7a96a04b08d2e3fa55ad84d78addcb19
URL: https://github.com/llvm/llvm-project/commit/fda3825c7a96a04b08d2e3fa55ad84d78addcb19
DIFF: https://github.com/llvm/llvm-project/commit/fda3825c7a96a04b08d2e3fa55ad84d78addcb19.diff
LOG: [libc++] Ensure __config always defines certain configuration macros.
Added:
Modified:
libcxx/include/__config
libcxx/include/__mutex_base
Removed:
################################################################################
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 67d2fd7a3e1b..a6ed5c69a47b 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -881,6 +881,10 @@ typedef unsigned int char32_t;
# endif
#endif
+#ifndef _LIBCPP_DEBUG_LEVEL
+# define _LIBCPP_DEBUG_LEVEL 0
+#endif
+
#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
#define _LIBCPP_EXTERN_TEMPLATE(...)
#define _LIBCPP_EXTERN_TEMPLATE2(...)
@@ -1254,6 +1258,14 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
# endif
#endif
+#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION
+# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
+# else
+# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
+# endif
+#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION
+
#if __has_attribute(require_constant_initialization)
# define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
#else
diff --git a/libcxx/include/__mutex_base b/libcxx/include/__mutex_base
index ed75c82380a6..8b4b74802b19 100644
--- a/libcxx/include/__mutex_base
+++ b/libcxx/include/__mutex_base
@@ -29,15 +29,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
-#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION
-# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
-# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
-# else
-# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
-# endif
-#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION
-
-
class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
{
__libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
More information about the libcxx-commits
mailing list