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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@340224 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/cstddef b/include/cstddef
index 1dc5d39..b45dbe2 100644
--- a/include/cstddef
+++ b/include/cstddef
@@ -50,7 +50,7 @@
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
diff --git a/include/stddef.h b/include/stddef.h
index faf8552..f65065d 100644
--- a/include/stddef.h
+++ b/include/stddef.h
@@ -54,7 +54,7 @@
// 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