From d2c4e60115b263991540cf9707bb55e47e135adb Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Sat, 1 Feb 2020 20:11:32 +0100 Subject: align to max_align_t --- libdislocator/libdislocator.so.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libdislocator/libdislocator.so.c b/libdislocator/libdislocator.so.c index 480d2fc6..21cd6f43 100644 --- a/libdislocator/libdislocator.so.c +++ b/libdislocator/libdislocator.so.c @@ -20,8 +20,10 @@ */ +#define _GNU_SOURCE #include #include +#include #include #include #include @@ -62,7 +64,12 @@ #include "config.h" #include "types.h" -#define ALLOC_ALIGN_SIZE (sizeof(void*)) +#if __STDC_VERSION__ < 201112L +// use this hack if not C11 +typedef struct { long long __ll; long double __ld; } max_align_t; +#endif + +#define ALLOC_ALIGN_SIZE (_Alignof(max_align_t)) #ifndef PAGE_SIZE #define PAGE_SIZE 4096 -- cgit 1.4.1