From 8557b0abe144e06e801183ff34eef11e05d86560 Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 23 Apr 2015 19:07:13 +0100 Subject: [PATCH] some platforms' C libs don't have max_align_t --- octa/traits.h | 2 +- octa/types.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/octa/traits.h b/octa/traits.h index 1741272..7027972 100644 --- a/octa/traits.h +++ b/octa/traits.h @@ -875,7 +875,7 @@ namespace octa { template struct AlignedStorageTest { union type { uchar data[N]; - max_align_t align; + octa::max_align_t align; }; }; }; diff --git a/octa/types.h b/octa/types.h index 4794b0d..8b287da 100644 --- a/octa/types.h +++ b/octa/types.h @@ -7,6 +7,7 @@ #define OCTA_TYPES_H #include +#include namespace octa { typedef signed char schar; @@ -20,6 +21,12 @@ namespace octa { typedef long double ldouble; typedef decltype(nullptr) nullptr_t; + +#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) + using ::max_align_t; +#else + typedef long double max_align_t; +#endif } #endif \ No newline at end of file