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

@ -102,12 +102,21 @@ else:
SysLock {.importc: "pthread_mutex_t", pure, final,
header: """#include <sys/types.h>
#include <pthread.h>""".} = object
when defined(linux) and defined(amd64):
abi: array[40 div sizeof(clong), clong]
SysLockAttr {.importc: "pthread_mutexattr_t", pure, final
header: """#include <sys/types.h>
#include <pthread.h>""".} = object
when defined(linux) and defined(amd64):
abi: array[4 div sizeof(cint), cint] # actually a cint
SysCond {.importc: "pthread_cond_t", pure, final,
header: """#include <sys/types.h>
#include <pthread.h>""".} = object
when defined(linux) and defined(amd64):
abi: array[48 div sizeof(clonglong), clonglong]
SysLockType = distinct cint
proc initSysLock(L: var SysLock, attr: ptr SysLockAttr = nil) {.