Reuse code in linux and amd64

This commit is contained in:
Joey Yakimowich-Payne 2018-06-19 19:38:05 +09:00
commit 3afe34468f

View file

@ -176,7 +176,7 @@ else:
else: else:
type Time = int type Time = int
when defined(linux) and defined(amd64): when defined(linux) and defined(amd64) and defined(nintendoswitch):
type type
SysThread* {.importc: "pthread_t", SysThread* {.importc: "pthread_t",
header: "<sys/types.h>" .} = distinct culong header: "<sys/types.h>" .} = distinct culong
@ -185,14 +185,6 @@ else:
abi: array[56 div sizeof(clong), clong] abi: array[56 div sizeof(clong), clong]
ThreadVarSlot {.importc: "pthread_key_t", ThreadVarSlot {.importc: "pthread_key_t",
header: "<sys/types.h>".} = distinct cuint header: "<sys/types.h>".} = distinct cuint
elif defined(nintendoswitch):
type
SysThread* {.importc: "pthread_t",
header: "<sys/types.h>" .} = distinct cuint
Pthread_attr {.importc: "pthread_attr_t",
header: "<sys/types.h>".} = object
ThreadVarSlot {.importc: "pthread_key_t",
header: "<sys/types.h>".} = distinct cuint
else: else:
type type
SysThread* {.importc: "pthread_t", header: "<sys/types.h>".} = object SysThread* {.importc: "pthread_t", header: "<sys/types.h>".} = object