Skip to content

Commit

Permalink
followup nim-lang#17944, remove other abi fields
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed May 8, 2021
1 parent d4850b5 commit 5019f90
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
17 changes: 0 additions & 17 deletions lib/posix/posix_linux_amd64.nim
Original file line number Diff line number Diff line change
Expand Up @@ -150,35 +150,24 @@ type
Pid* {.importc: "pid_t", header: "<sys/types.h>".} = cint
Pthread_attr* {.importc: "pthread_attr_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[56 div sizeof(clong), clong]

Pthread_barrier* {.importc: "pthread_barrier_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[32 div sizeof(clong), clong]
Pthread_barrierattr* {.importc: "pthread_barrierattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]

Pthread_cond* {.importc: "pthread_cond_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[48 div sizeof(clonglong), clonglong]
Pthread_condattr* {.importc: "pthread_condattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]
Pthread_key* {.importc: "pthread_key_t", header: "<sys/types.h>".} = cuint
Pthread_mutex* {.importc: "pthread_mutex_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[48 div sizeof(clong), clong]
Pthread_mutexattr* {.importc: "pthread_mutexattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]
Pthread_once* {.importc: "pthread_once_t", header: "<sys/types.h>".} = cint
Pthread_rwlock* {.importc: "pthread_rwlock_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[56 div sizeof(clong), clong]
Pthread_rwlockattr* {.importc: "pthread_rwlockattr_t",
header: "<sys/types.h>".} = object
abi: array[8 div sizeof(clong), clong]
Pthread_spinlock* {.importc: "pthread_spinlock_t",
header: "<sys/types.h>".} = cint
Pthread* {.importc: "pthread_t", header: "<sys/types.h>".} = culong
Expand All @@ -201,8 +190,6 @@ type
domainname*: array[65, char]

Sem* {.importc: "sem_t", header: "<semaphore.h>", final, pure.} = object
abi: array[32 div sizeof(clong), clong]

Ipc_perm* {.importc: "struct ipc_perm",
header: "<sys/ipc.h>", final, pure.} = object ## struct ipc_perm
key: Key
Expand Down Expand Up @@ -286,16 +273,13 @@ type
## accessed as an atomic entity, even in the presence of asynchronous
## interrupts.
Sigset* {.importc: "sigset_t", header: "<signal.h>", final, pure.} = object
abi: array[1024 div (8 * sizeof(culong)), culong]

SigEvent* {.importc: "struct sigevent",
header: "<signal.h>", final, pure.} = object ## struct sigevent
sigev_value*: SigVal ## Signal value.
sigev_signo*: cint ## Signal number.
sigev_notify*: cint ## Notification type.
sigev_notify_function*: proc (x: SigVal) {.noconv.} ## Notification func.
sigev_notify_attributes*: ptr Pthread_attr ## Notification attributes.
abi: array[12, int]

SigVal* {.importc: "union sigval",
header: "<signal.h>", final, pure.} = object ## struct sigval
Expand Down Expand Up @@ -350,7 +334,6 @@ type
tv_usec*: Suseconds ## Microseconds.
TFdSet* {.importc: "fd_set", header: "<sys/select.h>",
final, pure.} = object
abi: array[1024 div (8 * sizeof(clong)), clong]

Mcontext* {.importc: "mcontext_t", header: "<ucontext.h>",
final, pure.} = object
Expand Down
16 changes: 1 addition & 15 deletions lib/posix/posix_nintendoswitch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -129,35 +129,24 @@ type
Pid* {.importc: "pid_t", header: "<sys/types.h>".} = cint
Pthread_attr* {.importc: "pthread_attr_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[56 div sizeof(clong), clong]

Pthread_barrier* {.importc: "pthread_barrier_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[32 div sizeof(clong), clong]
Pthread_barrierattr* {.importc: "pthread_barrierattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]

Pthread_cond* {.importc: "pthread_cond_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[48 div sizeof(clonglong), clonglong]
Pthread_condattr* {.importc: "pthread_condattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]
Pthread_key* {.importc: "pthread_key_t", header: "<sys/types.h>".} = cuint
Pthread_mutex* {.importc: "pthread_mutex_t", header: "<sys/types.h>",
pure, final.} = object
abi: array[48 div sizeof(clong), clong]
Pthread_mutexattr* {.importc: "pthread_mutexattr_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[4 div sizeof(cint), cint]
Pthread_once* {.importc: "pthread_once_t", header: "<sys/types.h>".} = cint
Pthread_rwlock* {.importc: "pthread_rwlock_t",
header: "<sys/types.h>", pure, final.} = object
abi: array[56 div sizeof(clong), clong]
Pthread_rwlockattr* {.importc: "pthread_rwlockattr_t",
header: "<sys/types.h>".} = object
abi: array[8 div sizeof(clong), clong]
Pthread_spinlock* {.importc: "pthread_spinlock_t",
header: "<sys/types.h>".} = cint
Pthread* {.importc: "pthread_t", header: "<sys/types.h>".} = culong
Expand All @@ -180,7 +169,6 @@ type
domainname*: array[65, char]

Sem* {.importc: "sem_t", header: "<semaphore.h>", final, pure.} = object
abi: array[32 div sizeof(clong), clong]

Stat* {.importc: "struct stat",
header: "<sys/stat.h>", final, pure.} = object ## struct stat
Expand Down Expand Up @@ -305,9 +293,7 @@ type
final, pure.} = object ## struct timeval
tv_sec*: Time ## Seconds.
tv_usec*: Suseconds ## Microseconds.
TFdSet* {.importc: "fd_set", header: "<sys/select.h>",
final, pure.} = object
abi: array[((64+(sizeof(clong) * 8)-1) div (sizeof(clong) * 8)), clong]
TFdSet* {.importc: "fd_set", header: "<sys/select.h>", final, pure.} = object

proc si_pid*(info: SigInfo): Pid =
## This might not be correct behavior. si_pid doesn't exist in Switch's
Expand Down
2 changes: 1 addition & 1 deletion lib/system/ansi_c.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ proc c_abort*() {.
when defined(linux) and defined(amd64):
type
C_JmpBuf* {.importc: "jmp_buf", header: "<setjmp.h>", bycopy.} = object
abi: array[200 div sizeof(clong), clong]
# xxx why `bycopy` only here and not in other `C_JmpBuf` declaration?
else:
type
C_JmpBuf* {.importc: "jmp_buf", header: "<setjmp.h>".} = object
Expand Down
3 changes: 0 additions & 3 deletions lib/system/threadlocalstorage.nim
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ else:
header: "<sys/types.h>" .} = distinct culong
Pthread_attr {.importc: "pthread_attr_t",
header: "<sys/types.h>".} = object
abi: array[56 div sizeof(clong), clong]
ThreadVarSlot {.importc: "pthread_key_t",
header: "<sys/types.h>".} = distinct cuint
elif defined(openbsd) and defined(amd64):
Expand Down Expand Up @@ -190,8 +189,6 @@ else:
result = pthread_getspecific(s)

type CpuSet {.importc: "cpu_set_t", header: schedh.} = object
when defined(linux) and defined(amd64):
abi: array[1024 div (8 * sizeof(culong)), culong]

proc cpusetZero(s: var CpuSet) {.importc: "CPU_ZERO", header: schedh.}
proc cpusetIncl(cpu: cint; s: var CpuSet) {.
Expand Down

0 comments on commit 5019f90

Please sign in to comment.