diff options
author | Wim <wim@42.be> | 2023-08-05 20:43:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-05 20:43:19 +0200 |
commit | 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (patch) | |
tree | b1355645342667209263cbd355dc0b4254f1e8fe /vendor/modernc.org/libc/libc.go | |
parent | 9459495484d6e06a3d46de64fccd8d06f7ccc72c (diff) | |
download | matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.gz matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.bz2 matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.zip |
Diffstat (limited to 'vendor/modernc.org/libc/libc.go')
-rw-r--r-- | vendor/modernc.org/libc/libc.go | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/vendor/modernc.org/libc/libc.go b/vendor/modernc.org/libc/libc.go index e1c00b0f..01d6793a 100644 --- a/vendor/modernc.org/libc/libc.go +++ b/vendor/modernc.org/libc/libc.go @@ -970,13 +970,24 @@ func Xatol(t *TLS, nptr uintptr) long { } } -// time_t mktime(struct tm *tm); -func Xmktime(t *TLS, ptm uintptr) time.Time_t { - loc := gotime.Local +func getLocalLocation() (loc *gotime.Location) { + loc = gotime.Local if r := getenv(Environ(), "TZ"); r != 0 { - zone, off := parseZone(GoString(r)) - loc = gotime.FixedZone(zone, off) + zname := GoString(r) + zone, off := parseZone(zname) + loc = gotime.FixedZone(zone, -off) + loc2, _ := gotime.LoadLocation(zname) + if loc2 != nil { + loc = loc2 + } } + return loc + +} + +// time_t mktime(struct tm *tm); +func Xmktime(t *TLS, ptm uintptr) time.Time_t { + loc := getLocalLocation() tt := gotime.Date( int((*time.Tm)(unsafe.Pointer(ptm)).Ftm_year+1900), gotime.Month((*time.Tm)(unsafe.Pointer(ptm)).Ftm_mon+1), |