diff options
Diffstat (limited to 'wv_mem.c')
| -rw-r--r-- | wv_mem.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,15 +1,12 @@ #include <stdlib.h> #include <stdint.h> #include <string.h> +#include <stdalign.h> #include "wv_mem.h" #include "wv_err.h" -/* Detect alignment pre-C11 */ -union wv_max_align { long l; double d; void *p; }; - -#define WV_ALIGNOF(type) offsetof(struct { char c; type member; }, member) -#define WV_ALIGNMENT WV_ALIGNOF(union wv_max_align) +#define WV_ALIGNMENT alignof(max_align_t) #define WV_ALIGN_MASK (WV_ALIGNMENT - 1) #define WV_ARENA_MIN_SIZE (256 * 1024) |
