From 99078d80d7abb1c47612bc70f7affbde8735066a Mon Sep 17 00:00:00 2001 From: Arne Döring Date: Thu, 31 Oct 2019 19:18:12 +0100 Subject: introduce csize_t instead of fixing csize (#12497) --- lib/posix/posix.nim | 6 ++++++ lib/posix/posix_linux_amd64.nim | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'lib/posix') diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index 044e0448f..27d6d08e9 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -870,9 +870,15 @@ proc CMSG_FIRSTHDR*(mhdr: ptr Tmsghdr): ptr Tcmsghdr {. importc, header: "".} proc CMSG_SPACE*(len: csize): csize {. + importc, header: "", deprecated: "argument `len` should be of type `csize_t`".} + +proc CMSG_SPACE*(len: csize_t): csize_t {. importc, header: "".} proc CMSG_LEN*(len: csize): csize {. + importc, header: "", deprecated: "argument `len` should be of type `csize_t`".} + +proc CMSG_LEN*(len: csize_t): csize_t {. importc, header: "".} const diff --git a/lib/posix/posix_linux_amd64.nim b/lib/posix/posix_linux_amd64.nim index be7934f2f..bb82d9e5e 100644 --- a/lib/posix/posix_linux_amd64.nim +++ b/lib/posix/posix_linux_amd64.nim @@ -66,9 +66,9 @@ type Glob* {.importc: "glob_t", header: "", final, pure.} = object ## glob_t - gl_pathc*: csize ## Count of paths matched by pattern. - gl_pathv*: cstringArray ## Pointer to a list of matched pathnames. - gl_offs*: csize ## Slots to reserve at the beginning of gl_pathv. + gl_pathc*: csize_t ## Count of paths matched by pattern. + gl_pathv*: cstringArray ## Pointer to a list of matched pathnames. + gl_offs*: csize_t ## Slots to reserve at the beginning of gl_pathv. gl_flags*: cint gl_closedir*: pointer gl_readdir*: pointer @@ -382,7 +382,7 @@ type aio_lio_opcode*: cint ## Operation to be performed. aio_reqprio*: cint ## Request priority offset. aio_buf*: pointer ## Location of buffer. - aio_nbytes*: csize ## Length of transfer. + aio_nbytes*: csize_t ## Length of transfer. aio_sigevent*: SigEvent ## Signal number and value. next_prio: pointer abs_prio: cint @@ -445,22 +445,22 @@ type IOVec* {.importc: "struct iovec", pure, final, header: "".} = object ## struct iovec iov_base*: pointer ## Base address of a memory region for input or output. - iov_len*: csize ## The size of the memory pointed to by iov_base. + iov_len*: csize_t ## The size of the memory pointed to by iov_base. Tmsghdr* {.importc: "struct msghdr", pure, final, header: "".} = object ## struct msghdr msg_name*: pointer ## Optional address. msg_namelen*: SockLen ## Size of address. msg_iov*: ptr IOVec ## Scatter/gather array. - msg_iovlen*: csize ## Members in msg_iov. + msg_iovlen*: csize_t ## Members in msg_iov. msg_control*: pointer ## Ancillary data; see below. - msg_controllen*: csize ## Ancillary data buffer len. + msg_controllen*: csize_t ## Ancillary data buffer len. msg_flags*: cint ## Flags on received message. Tcmsghdr* {.importc: "struct cmsghdr", pure, final, header: "".} = object ## struct cmsghdr - cmsg_len*: csize ## Data byte count, including the cmsghdr. + cmsg_len*: csize_t ## Data byte count, including the cmsghdr. cmsg_level*: cint ## Originating protocol. cmsg_type*: cint ## Protocol-specific type. -- cgit 1.4.1-2-gfad0