Expose CTime (#10301)

This commit is contained in:
genotrance 2019-01-14 15:16:11 -06:00 • committed by Andreas Rumpf
commit dd1f23f6fc

View file

@ -217,7 +217,7 @@ when defined(JS):
elif defined(posix): elif defined(posix):
import posix import posix
type CTime = posix.Time type CTime* = posix.Time
var var
realTimeClockId {.importc: "CLOCK_REALTIME", header: "<time.h>".}: Clockid realTimeClockId {.importc: "CLOCK_REALTIME", header: "<time.h>".}: Clockid
@ -236,10 +236,10 @@ elif defined(windows):
import winlean import winlean
when defined(i386) and defined(gcc): when defined(i386) and defined(gcc):
type CTime {.importc: "time_t", header: "<time.h>".} = distinct int32 type CTime* {.importc: "time_t", header: "<time.h>".} = distinct int32
else: else:
# newest version of Visual C++ defines time_t to be of 64 bits # newest version of Visual C++ defines time_t to be of 64 bits
type CTime {.importc: "time_t", header: "<time.h>".} = distinct int64 type CTime* {.importc: "time_t", header: "<time.h>".} = distinct int64
# visual c's c runtime exposes these under a different name # visual c's c runtime exposes these under a different name
var timezone {.importc: "_timezone", header: "<time.h>".}: int var timezone {.importc: "_timezone", header: "<time.h>".}: int