[libcxx] r294683 - Check for musl-libc's max_align_t in addition to other variants.

David L. Jones via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 17:27:43 PST 2017


Author: dlj
Date: Thu Feb  9 19:27:42 2017
New Revision: 294683

URL: http://llvm.org/viewvc/llvm-project?rev=294683&view=rev
Log:
Check for musl-libc's max_align_t in addition to other variants.

Summary:
Libcxx will define its own max_align_t when it is not available. However, the
availability checks today only check for Clang's definition and GCC's
definition. In particular, it does not check for musl's definition, which is the
same as GCC's but guarded with a different macro.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: chandlerc, cfe-commits

Differential Revision: https://reviews.llvm.org/D28478

Modified:
    libcxx/trunk/include/cstddef
    libcxx/trunk/include/stddef.h

Modified: libcxx/trunk/include/cstddef
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cstddef?rev=294683&r1=294682&r2=294683&view=diff
==============================================================================
--- libcxx/trunk/include/cstddef (original)
+++ libcxx/trunk/include/cstddef Thu Feb  9 19:27:42 2017
@@ -48,7 +48,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 using ::ptrdiff_t;
 using ::size_t;
 
-#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
+#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) || \
+    defined(__DEFINED_max_align_t)
 // Re-use the compiler's <stddef.h> max_align_t where possible.
 using ::max_align_t;
 #else

Modified: libcxx/trunk/include/stddef.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/stddef.h?rev=294683&r1=294682&r2=294683&view=diff
==============================================================================
--- libcxx/trunk/include/stddef.h (original)
+++ libcxx/trunk/include/stddef.h Thu Feb  9 19:27:42 2017
@@ -53,7 +53,8 @@ using std::nullptr_t;
 }
 
 // Re-use the compiler's <stddef.h> max_align_t where possible.
-#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T)
+#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) && \
+    !defined(__DEFINED_max_align_t)
 typedef long double max_align_t;
 #endif
 




More information about the cfe-commits mailing list