diff options
author | Zahary Karadjov <zahary@gmail.com> | 2014-03-06 23:25:45 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2014-03-06 23:25:45 +0200 |
commit | 2cbe46daff73987d819ea0ca4bc6ada919d531d4 (patch) | |
tree | 26aac8e46dfb434ba8076e5ad8ebcbdc70c32a9f /lib/nimbase.h | |
parent | ee1b0d8c6784c30307bcddc7ab8ace0bba35e853 (diff) | |
parent | 7500a5ea0bc4643c37f3ab8cbee8cb5e01678032 (diff) | |
download | Nim-2cbe46daff73987d819ea0ca4bc6ada919d531d4.tar.gz |
Merge branch 'devel' of github.com:Araq/Nimrod into devel
Diffstat (limited to 'lib/nimbase.h')
-rw-r--r-- | lib/nimbase.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h index 19d161adf..1100e084b 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -285,8 +285,8 @@ static N_INLINE(NI32, float32ToInt32)(float x) { typedef struct TStringDesc* string; -/* declared size of a sequence: */ -#if defined(__GNUC__) +/* declared size of a sequence/variable length array: */ +#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER) # define SEQ_DECL_SIZE /* empty is correct! */ #else # define SEQ_DECL_SIZE 1000000 @@ -373,5 +373,8 @@ static inline void GCGuard (void *ptr) { asm volatile ("" :: "X" (ptr)); } # define GC_GUARD #endif +/* Test to see if nimrod and the C compiler agrees on the size of a pointer. + On disagreement, your C compiler will say something like: + "error: 'assert_numbits' declared as an array with a negative size" */ typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; #endif |