Use <time.h> instead of <sys/time.h> for tzset and time_t
This fixes compilation on Linux.
This commit is contained in:
parent
9c2da4cb62
commit
b0c64bf848
1 changed files with 73 additions and 73 deletions
|
|
@ -33,7 +33,7 @@ when not defined(JS):
|
||||||
|
|
||||||
when defined(posix) and not defined(JS):
|
when defined(posix) and not defined(JS):
|
||||||
type
|
type
|
||||||
TimeImpl {.importc: "time_t", header: "<sys/time.h>".} = int
|
TimeImpl {.importc: "time_t", header: "<time.h>".} = int
|
||||||
Time* = distinct TimeImpl ## distinct type that represents a time
|
Time* = distinct TimeImpl ## distinct type that represents a time
|
||||||
## measured as number of seconds since the epoch
|
## measured as number of seconds since the epoch
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ when defined(posix) and not defined(JS):
|
||||||
importc: "gettimeofday", header: "<sys/time.h>".}
|
importc: "gettimeofday", header: "<sys/time.h>".}
|
||||||
|
|
||||||
# we also need tzset() to make sure that tzname is initialized
|
# we also need tzset() to make sure that tzname is initialized
|
||||||
proc tzset() {.importc, header: "<sys/time.h>".}
|
proc tzset() {.importc, header: "<time.h>".}
|
||||||
# calling tzset() implicitly to initialize tzname data.
|
# calling tzset() implicitly to initialize tzname data.
|
||||||
tzset()
|
tzset()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue