summaryrefslogtreecommitdiffstats
path: root/libcxx/include/cstddef
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-02-21 08:37:30 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-02-21 08:37:30 +0000
commit265b83a87f2bc31bb31fd7a0802b030f96c617a0 (patch)
tree4d808bc2161cf549eb8b453d7ce12cedd6eef766 /libcxx/include/cstddef
parent7da9487dd4494fa3037e06c64ae03a862fdbcd02 (diff)
downloadbcm5719-llvm-265b83a87f2bc31bb31fd7a0802b030f96c617a0.tar.gz
bcm5719-llvm-265b83a87f2bc31bb31fd7a0802b030f96c617a0.zip
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. llvm-svn: 201843
Diffstat (limited to 'libcxx/include/cstddef')
-rw-r--r--libcxx/include/cstddef5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index 7ef16ff2a36..0030ec289a8 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/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
OpenPOWER on IntegriCloud