Use <time.h> instead of <sys/time.h> for tzset and time_t

This fixes compilation on Linux.
This commit is contained in:
def 2015-03-23 11:03:44 +01:00
commit b0c64bf848

View file

@ -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()