diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-04-23 02:24:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 11:24:09 +0200 |
commit | 66db9de714be7c2f4cf1f2fb0a0a99145baf6acb (patch) | |
tree | 8675842299fe22ad237b06bb923a880789c9faa4 /lib | |
parent | 5c534b2943145106db99212fb9bb75fde289b6f5 (diff) | |
download | Nim-66db9de714be7c2f4cf1f2fb0a0a99145baf6acb.tar.gz |
CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks (#13926)
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper * cleanups * import sizeof at CT for {.completeType.} * address comments; revert default enabling of -d:checkAbi for now * mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor * all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
Diffstat (limited to 'lib')
-rw-r--r-- | lib/nimbase.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/nimbase.h b/lib/nimbase.h index d4fa10050..0b0188b55 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -562,10 +562,6 @@ NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "" # include <sys/types.h> #endif -/* Compile with -d:checkAbi and a sufficiently C11:ish compiler to enable */ -#define NIM_CHECK_SIZE(typ, sz) \ - _Static_assert(sizeof(typ) == sz, "Nim & C disagree on type size") - /* these exist to make the codegen logic simpler */ #define nimModInt(a, b, res) (((*res) = (a) % (b)), 0) #define nimModInt64(a, b, res) (((*res) = (a) % (b)), 0) |