posix_other: add define to force time_t to 64 bit [backport] (#14753)
This is a temporary remedy for time_t transition to 64 bit on newer Linux libc (musl >= 1.2.0, glibc >= 2.32). In the future we might want to move away from libc, or figure out a way to reliably detect the real size of C types at compile time, both of which are difficult.
This commit is contained in:
parent
1e484ed62b
commit
c8554ebc0c
1 changed files with 6 additions and 1 deletions
|
|
@ -32,7 +32,12 @@ type
|
||||||
SocketHandle* = distinct cint # The type used to represent socket descriptors
|
SocketHandle* = distinct cint # The type used to represent socket descriptors
|
||||||
|
|
||||||
type
|
type
|
||||||
Time* {.importc: "time_t", header: "<time.h>".} = distinct clong
|
Time* {.importc: "time_t", header: "<time.h>".} = distinct (
|
||||||
|
when defined(nimUse64BitCTime):
|
||||||
|
int64
|
||||||
|
else:
|
||||||
|
clong
|
||||||
|
)
|
||||||
|
|
||||||
Timespec* {.importc: "struct timespec",
|
Timespec* {.importc: "struct timespec",
|
||||||
header: "<time.h>", final, pure.} = object ## struct timespec
|
header: "<time.h>", final, pure.} = object ## struct timespec
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue