import the correct symbols on windows
This commit is contained in:
parent
fd7b7a0bc1
commit
ad896f03e8
1 changed files with 7 additions and 6 deletions
|
|
@ -26,11 +26,6 @@ type
|
||||||
WeekDay* = enum ## represents a weekday
|
WeekDay* = enum ## represents a weekday
|
||||||
dMon, dTue, dWed, dThu, dFri, dSat, dSun
|
dMon, dTue, dWed, dThu, dFri, dSat, dSun
|
||||||
|
|
||||||
when not defined(JS):
|
|
||||||
var
|
|
||||||
timezone {.importc, header: "<time.h>".}: int
|
|
||||||
tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
|
||||||
|
|
||||||
when defined(posix) and not defined(JS):
|
when defined(posix) and not defined(JS):
|
||||||
type
|
type
|
||||||
TimeImpl {.importc: "time_t", header: "<time.h>".} = int
|
TimeImpl {.importc: "time_t", header: "<time.h>".} = int
|
||||||
|
|
@ -49,6 +44,9 @@ when defined(posix) and not defined(JS):
|
||||||
proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {.
|
proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {.
|
||||||
importc: "gettimeofday", header: "<sys/time.h>".}
|
importc: "gettimeofday", header: "<sys/time.h>".}
|
||||||
|
|
||||||
|
var
|
||||||
|
timezone {.importc, header: "<time.h>".}: int
|
||||||
|
tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
||||||
# 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: "<time.h>".}
|
proc tzset() {.importc, header: "<time.h>".}
|
||||||
# calling tzset() implicitly to initialize tzname data.
|
# calling tzset() implicitly to initialize tzname data.
|
||||||
|
|
@ -66,6 +64,9 @@ elif defined(windows):
|
||||||
type
|
type
|
||||||
Time* = distinct TimeImpl
|
Time* = distinct TimeImpl
|
||||||
|
|
||||||
|
var
|
||||||
|
timezone {.importc: "_timezone", header: "<time.h>".}: int
|
||||||
|
tzname {.importc: "_tzname", header: "<time.h>"}: array[0..1, cstring]
|
||||||
elif defined(JS):
|
elif defined(JS):
|
||||||
type
|
type
|
||||||
Time* {.importc.} = object
|
Time* {.importc.} = object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue