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:
parent
926563f0e6
commit
e512358bc9
7 changed files with 86 additions and 35 deletions
|
|
@ -38,8 +38,10 @@ type
|
|||
epoll_data* {.importc: "union epoll_data",
|
||||
header: "<sys/epoll.h>", pure, final.} = object # TODO: This is actually a union.
|
||||
#thePtr* {.importc: "ptr".}: pointer
|
||||
fd* {.importc: "fd".}: cint # \
|
||||
#u32*: uint32
|
||||
fd* {.importc: "fd".}: cint
|
||||
when defined(linux) and defined(amd64):
|
||||
u32: uint32 # this field ensures that binary size is right - it cannot be
|
||||
# used because its offset is wrong
|
||||
#u64*: uint64
|
||||
|
||||
epoll_event* {.importc: "struct epoll_event", header: "<sys/epoll.h>", pure, final.} = object
|
||||
|
|
|
|||
|
|
@ -18,13 +18,25 @@ type
|
|||
const
|
||||
NCCS* = when defined(macosx): 20 else: 32
|
||||
|
||||
type
|
||||
Termios* {.importc: "struct termios", header: "<termios.h>".} = object
|
||||
c_iflag*: Cflag # input mode flags
|
||||
c_oflag*: Cflag # output mode flags
|
||||
c_cflag*: Cflag # control mode flags
|
||||
c_lflag*: Cflag # local mode flags
|
||||
c_cc*: array[NCCS, cuchar] # control characters
|
||||
when defined(linux) and defined(amd64):
|
||||
type
|
||||
Termios* {.importc: "struct termios", header: "<termios.h>".} = object
|
||||
c_iflag*: Cflag # input mode flags
|
||||
c_oflag*: Cflag # output mode flags
|
||||
c_cflag*: Cflag # control mode flags
|
||||
c_lflag*: Cflag # local mode flags
|
||||
c_line*: cuchar
|
||||
c_cc*: array[NCCS, cuchar] # control characters
|
||||
c_ispeed*: Speed
|
||||
c_ospeed*: Speed
|
||||
else:
|
||||
type
|
||||
Termios* {.importc: "struct termios", header: "<termios.h>".} = object
|
||||
c_iflag*: Cflag # input mode flags
|
||||
c_oflag*: Cflag # output mode flags
|
||||
c_cflag*: Cflag # control mode flags
|
||||
c_lflag*: Cflag # local mode flags
|
||||
c_cc*: array[NCCS, cuchar] # control characters
|
||||
|
||||
# cc characters
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue