diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-02-21 08:37:30 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-02-21 08:37:30 +0000 |
commit | f84f6118b3ef1084ffd6ea437f3859339aab5b39 (patch) | |
tree | b16d3b7fd03aedf4c51b44f97494d097b6d5a498 /include/cstddef | |
parent | e0f8672e7a9a08a75ff1abc230a850849c48380f (diff) |
Teach libc++ to use the compiler-provided C-compatible ::max_align_t
rather than its own type for std::max_align_t. This is particularly
relevant as the types may not be ABI compatible despite users expecting
them to be.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/cstddef')
-rw-r--r-- | include/cstddef | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cstddef b/include/cstddef index 7ef16ff2a..0030ec289 100644 --- a/include/cstddef +++ b/include/cstddef @@ -52,7 +52,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD using ::ptrdiff_t; using ::size_t; +#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) +// Re-use the compiler's <stddef.h> max_align_t where possible. +using ::max_align_t; +#else typedef long double max_align_t; +#endif #ifdef _LIBCPP_HAS_NO_NULLPTR |