From 58f3e07b1a84b2cbe1c1fab690b8dd6b9ed5a296 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 15 Nov 2019 20:24:14 +0100 Subject: fixes and changes the recently introduced 'alignas' to be 'align' (#12666) * fixes and changes the recently introduced 'alignas' to be 'align' * more improvements --- lib/nimbase.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/nimbase.h') diff --git a/lib/nimbase.h b/lib/nimbase.h index fb6861ec7..732d3975f 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -256,7 +256,6 @@ __clang__ #include #include -#include /* C99 compiler? */ #if (defined(__STD_VERSION__) && (__STD_VERSION__ >= 199901)) @@ -467,6 +466,12 @@ typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == siz # define NIM_EXTERNC #endif +#if defined(_MSC_VER) +# define NIM_ALIGN(x) __declspec(align(x)) +#else +# define NIM_ALIGN(x) __attribute__((aligned(x))) +#endif + /* ---------------- platform specific includes ----------------------- */ /* VxWorks related includes */ -- cgit 1.4.1-2-gfad0