[libcxx] r340224 - Teach libc++ to use native NetBSD's max_align_t
Kamil Rytarowski via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 20 15:29:20 PDT 2018
Author: kamil
Date: Mon Aug 20 15:29:20 2018
New Revision: 340224
URL: http://llvm.org/viewvc/llvm-project?rev=340224&view=rev
Log:
Teach libc++ to use native NetBSD's max_align_t
Summary:
The NetBSD headers ship with max_align_t, that is not
compatible with the fallback version in libc++.
There is no defined a compiler specific symbol in the headers like:
- __CLANG_MAX_ALIGN_T_DEFINED
- _GCC_MAX_ALIGN_T
- __DEFINED_max_align_t
Sponsored by <The NetBSD Foundation>
Reviewers: chandlerc, dlj, EricWF, joerg
Reviewed By: joerg
Subscribers: bsdjhb, llvm-commits, cfe-commits
Differential Revision: https://reviews.llvm.org/D47814
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=340224&r1=340223&r2=340224&view=diff
==============================================================================
--- libcxx/trunk/include/cstddef (original)
+++ libcxx/trunk/include/cstddef Mon Aug 20 15:29:20 2018
@@ -50,7 +50,7 @@ using ::ptrdiff_t;
using ::size_t;
#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) || \
- defined(__DEFINED_max_align_t)
+ defined(__DEFINED_max_align_t) || defined(__NetBSD__)
// 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=340224&r1=340223&r2=340224&view=diff
==============================================================================
--- libcxx/trunk/include/stddef.h (original)
+++ libcxx/trunk/include/stddef.h Mon Aug 20 15:29:20 2018
@@ -54,7 +54,7 @@ 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) && \
- !defined(__DEFINED_max_align_t)
+ !defined(__DEFINED_max_align_t) && !defined(__NetBSD__)
typedef long double max_align_t;
#endif
More information about the cfe-commits
mailing list