Merge pull request #4994 from arnetheduck/nim-check-abi
add a simple sizeof checker to compare nim & c types
This commit is contained in:
commit
86b58e83ea
3 changed files with 21 additions and 1 deletions
|
|
@ -459,3 +459,7 @@ typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == siz
|
|||
#elif defined(__FreeBSD__)
|
||||
# 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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue