diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-11-15 20:24:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15 20:24:14 +0100 |
commit | 58f3e07b1a84b2cbe1c1fab690b8dd6b9ed5a296 (patch) | |
tree | ef7096e37cb19c340c4bdeb04b4ae2e6bb5ec1d2 /lib/nimbase.h | |
parent | 9c46526cfa928f884b06ea78f3f7304bdc626ed1 (diff) | |
download | Nim-58f3e07b1a84b2cbe1c1fab690b8dd6b9ed5a296.tar.gz |
fixes and changes the recently introduced 'alignas' to be 'align' (#12666)
* fixes and changes the recently introduced 'alignas' to be 'align' * more improvements
Diffstat (limited to 'lib/nimbase.h')
-rw-r--r-- | lib/nimbase.h | 7 |
1 files changed, 6 insertions, 1 deletions
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 <limits.h> #include <stddef.h> -#include <stdalign.h> /* 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 */ |