Adding OpenBSD to defines
This commit is contained in:
parent
b7f2058833
commit
2264bd6097
1 changed files with 4 additions and 4 deletions
|
|
@ -64,7 +64,7 @@ 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>".}
|
||||||
|
|
||||||
when not defined(freebsd) and not defined(netbsd):
|
when not defined(freebsd) and not defined(netbsd) and not defined(openbsd):
|
||||||
var timezone {.importc, header: "<time.h>".}: int
|
var timezone {.importc, header: "<time.h>".}: int
|
||||||
var
|
var
|
||||||
tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
tzname {.importc, header: "<time.h>" .}: array[0..1, cstring]
|
||||||
|
|
@ -417,7 +417,7 @@ when not defined(JS):
|
||||||
|
|
||||||
when not defined(JS):
|
when not defined(JS):
|
||||||
# C wrapper:
|
# C wrapper:
|
||||||
when defined(freebsd) or defined(netbsd):
|
when defined(freebsd) or defined(netbsd) or defined(openbsd):
|
||||||
type
|
type
|
||||||
StructTM {.importc: "struct tm", final.} = object
|
StructTM {.importc: "struct tm", final.} = object
|
||||||
second {.importc: "tm_sec".},
|
second {.importc: "tm_sec".},
|
||||||
|
|
@ -472,7 +472,7 @@ when not defined(JS):
|
||||||
const
|
const
|
||||||
weekDays: array [0..6, WeekDay] = [
|
weekDays: array [0..6, WeekDay] = [
|
||||||
dSun, dMon, dTue, dWed, dThu, dFri, dSat]
|
dSun, dMon, dTue, dWed, dThu, dFri, dSat]
|
||||||
when defined(freebsd) or defined(netbsd):
|
when defined(freebsd) or defined(netbsd) or defined(openbsd):
|
||||||
TimeInfo(second: int(tm.second),
|
TimeInfo(second: int(tm.second),
|
||||||
minute: int(tm.minute),
|
minute: int(tm.minute),
|
||||||
hour: int(tm.hour),
|
hour: int(tm.hour),
|
||||||
|
|
@ -602,7 +602,7 @@ when not defined(JS):
|
||||||
return ($tzname[0], $tzname[1])
|
return ($tzname[0], $tzname[1])
|
||||||
|
|
||||||
proc getTimezone(): int =
|
proc getTimezone(): int =
|
||||||
when defined(freebsd) or defined(netbsd):
|
when defined(freebsd) or defined(netbsd) or defined(openbsd):
|
||||||
var a = timec(nil)
|
var a = timec(nil)
|
||||||
let lt = localtime(addr(a))
|
let lt = localtime(addr(a))
|
||||||
# BSD stores in `gmtoff` offset east of UTC in seconds,
|
# BSD stores in `gmtoff` offset east of UTC in seconds,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue