Linux abi take 3 (#5692)

* avoid generating object fields for imported types
* fix some abi/type issues for linux_amd64
This commit is contained in:
Jacek Sieka 2017-04-13 04:57:10 +08:00 • committed by Andreas Rumpf
commit e512358bc9
7 changed files with 86 additions and 35 deletions

View file

@ -26,8 +26,14 @@ proc c_memset(p: pointer, value: cint, size: csize): pointer {.
proc c_strcmp(a, b: cstring): cint {.
importc: "strcmp", header: "<string.h>", noSideEffect.}
type
C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = object
when defined(linux) and defined(amd64):
type
C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>", bycopy.} = object
abi: array[200 div sizeof(clong), clong]
else:
type
C_JmpBuf {.importc: "jmp_buf", header: "<setjmp.h>".} = object
when defined(windows):
const