some platforms' C libs don't have max_align_t

master
Daniel Kolesa 2015-04-23 19:07:13 +01:00
parent c388e8c09a
commit 8557b0abe1
2 changed files with 8 additions and 1 deletions

View File

@ -875,7 +875,7 @@ namespace octa {
template<size_t N> struct AlignedStorageTest {
union type {
uchar data[N];
max_align_t align;
octa::max_align_t align;
};
};
};

View File

@ -7,6 +7,7 @@
#define OCTA_TYPES_H
#include <stdint.h>
#include <stddef.h>
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