Update dependencies

This commit is contained in:
TwinProduction
2021-10-03 22:15:20 -04:00
parent 2d3fe9795f
commit 154bc7dbc6
1204 changed files with 373532 additions and 50576 deletions

View File

@ -226,24 +226,21 @@ func newFile(t *TLS, fd int32) uintptr {
if err != nil {
panic("no console")
}
f := addFile(h, fd)
return uintptr(unsafe.Pointer(f))
return addFile(h, fd)
}
if fd == unistd.STDOUT_FILENO {
h, err := syscall.GetStdHandle(syscall.STD_OUTPUT_HANDLE)
if err != nil {
panic("no console")
}
f := addFile(h, fd)
return uintptr(unsafe.Pointer(f))
return addFile(h, fd)
}
if fd == unistd.STDERR_FILENO {
h, err := syscall.GetStdHandle(syscall.STD_ERROR_HANDLE)
if err != nil {
panic("no console")
}
f := addFile(h, fd)
return uintptr(unsafe.Pointer(f))
return addFile(h, fd)
}
// should not get here -- unless newFile
@ -483,7 +480,7 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, cmode uintptr) int32 {
var mode types.Mode_t
if cmode != 0 {
mode = *(*types.Mode_t)(unsafe.Pointer(cmode))
mode = (types.Mode_t)(VaUint32(&cmode))
}
// fdcwd := fcntl.AT_FDCWD
h, err := syscall.Open(GoString(pathname), int(flags), uint32(mode))
@ -5355,3 +5352,18 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 {
func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */
panic(todo(""))
}
func Xrint(tls *TLS, x float64) float64 {
switch {
case x == 0: // also +0 and -0
return 0
case math.IsInf(x, 0), math.IsNaN(x):
return x
case x >= math.MinInt64 && x <= math.MaxInt64 && float64(int64(x)) == x:
return x
case x >= 0:
return math.Floor(x + 0.5)
default:
return math.Ceil(x - 0.5)
}
}