diff options
Diffstat (limited to 'vendor/modernc.org/libc/musl_darwin_amd64.go')
-rw-r--r-- | vendor/modernc.org/libc/musl_darwin_amd64.go | 77 |
1 files changed, 59 insertions, 18 deletions
diff --git a/vendor/modernc.org/libc/musl_darwin_amd64.go b/vendor/modernc.org/libc/musl_darwin_amd64.go index 01bde4691..4860bf4ff 100644 --- a/vendor/modernc.org/libc/musl_darwin_amd64.go +++ b/vendor/modernc.org/libc/musl_darwin_amd64.go @@ -1,4 +1,4 @@ -// Code generated by 'ccgo -D__environ=environ -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_darwin_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/env/putenv.c src/env/setenv.c src/env/unsetenv.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__toread.c src/stdio/__uflow.c src/string/strdup.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strchrnul.c src/string/strlcat.c src/string/strlcpy.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c', DO NOT EDIT. +// Code generated by 'ccgo -D__environ=environ -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_darwin_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/env/putenv.c src/env/setenv.c src/env/unsetenv.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/rint.c src/math/scalbn.c src/math/scalbnl.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__toread.c src/stdio/__uflow.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strchrnul.c src/string/strdup.c src/string/strlcat.c src/string/strlcpy.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c', DO NOT EDIT. package libc @@ -1855,7 +1855,10 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ bp := tls.Alloc(8) defer tls.Free(8) - *(*struct{ f float64 })(unsafe.Pointer(bp /* u */)) = struct{ f float64 }{f: x} + *(*struct{ f float64 })(unsafe.Pointer(bp /* u */)) = func() (r struct{ f float64 }) { + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x + return r + }() var e int32 = (int32((*(*uint64_t)(unsafe.Pointer(bp /* &u */)) >> 52) & uint64(0x7ff))) if !(e != 0) { if (*(*uint64_t)(unsafe.Pointer(bp /* &u */)) << 1) != 0 { @@ -1876,7 +1879,10 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ bp := tls.Alloc(4) defer tls.Free(4) - *(*struct{ f float32 })(unsafe.Pointer(bp /* u */)) = struct{ f float32 }{f: x} + *(*struct{ f float32 })(unsafe.Pointer(bp /* u */)) = func() (r struct{ f float32 }) { + *(*float32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x + return r + }() var e int32 = (int32((*(*uint32_t)(unsafe.Pointer(bp /* &u */)) >> 23) & uint32_t(0xff))) if !(e != 0) { if (*(*uint32_t)(unsafe.Pointer(bp /* &u */)) << 1) != 0 { @@ -1917,6 +1923,37 @@ func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ return X__builtin_nanf(tls, ts+13 /* "" */) } +var toint double_t = (float64(float64(1)) / 2.22044604925031308085e-16) /* rint.c:10:23 */ + +func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + bp := tls.Alloc(8) + defer tls.Free(8) + + *(*struct{ f float64 })(unsafe.Pointer(bp /* u */)) = func() (r struct{ f float64 }) { + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x + return r + }() + var e int32 = (int32((*(*uint64_t)(unsafe.Pointer(bp /* &u */)) >> 52) & uint64(0x7ff))) + var s int32 = (int32(*(*uint64_t)(unsafe.Pointer(bp /* &u */)) >> 63)) + var y double_t + + if e >= (0x3ff + 52) { + return x + } + if s != 0 { + y = ((x - toint) + toint) + } else { + y = ((x + toint) - toint) + } + if y == float64(0) { + if s != 0 { + return -Float64FromFloat64(0.0) + } + return float64(0) + } + return y +} + func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ bp := tls.Alloc(8) defer tls.Free(8) @@ -2985,11 +3022,11 @@ type __res_state = struct { defdname [256]int8 pfcode uint64 ndots uint32 /* unsigned ndots: 4, unsigned nsort: 4, unsigned ipv6_unavail: 1, unsigned unused: 23 */ + _ [4]byte sort_list [10]struct { addr struct{ s_addr in_addr_t } mask uint32_t } - _ [4]byte qhook uintptr rhook uintptr res_h_errno int32 @@ -3267,15 +3304,15 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 switch i { case 0: *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 1*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */)) & uint64(0xffffff)) - AssignShrPtrUint64(bp /* &a */, int(uint64(24))) + AssignShrPtrUint64(bp /* &a */, int(24)) fallthrough case 1: *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 2*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 1*8)) & uint64(0xffff)) - AssignShrPtrUint64(bp /* &a */ +1*8, int(uint64(16))) + AssignShrPtrUint64(bp /* &a */ +1*8, int(16)) fallthrough case 2: *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 3*8)) = (*(*uint64)(unsafe.Pointer(bp /* &a[0] */ + 2*8)) & uint64(0xff)) - AssignShrPtrUint64(bp /* &a */ +2*8, int(uint64(8))) + AssignShrPtrUint64(bp /* &a */ +2*8, int(8)) } for i = 0; i < 4; i++ { if *(*uint64)(unsafe.Pointer(bp /* &a[0] */ + uintptr(i)*8)) > uint64(255) { @@ -4085,7 +4122,9 @@ func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ *(*int32)(unsafe.Pointer(f + 136 /* &.mode */)) |= ((*FILE)(unsafe.Pointer(f)).mode - 1) if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { - (*(*func(*TLS, uintptr, uintptr, size_t) size_t)(unsafe.Pointer((f + 72 /* &.write */))))(tls, f, uintptr(0), uint64(0)) + (*struct { + f func(*TLS, uintptr, uintptr, size_t) size_t + })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).write})).f(tls, f, uintptr(0), uint64(0)) } (*FILE)(unsafe.Pointer(f)).wpos = AssignPtrUintptr(f+56 /* &.wbase */, AssignPtrUintptr(f+32 /* &.wend */, uintptr(0))) if ((*FILE)(unsafe.Pointer(f)).flags & uint32(4)) != 0 { @@ -4113,21 +4152,14 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ // var c uint8 at bp, 1 - if !(X__toread(tls, f) != 0) && ((*(*func(*TLS, uintptr, uintptr, size_t) size_t)(unsafe.Pointer((f + 64 /* &.read */))))(tls, f, bp /* &c */, uint64(1)) == uint64(1)) { + if !(X__toread(tls, f) != 0) && ((*struct { + f func(*TLS, uintptr, uintptr, size_t) size_t + })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).read})).f(tls, f, bp /* &c */, uint64(1)) == uint64(1)) { return int32(*(*uint8)(unsafe.Pointer(bp /* c */))) } return -1 } -func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ - var l size_t = Xstrlen(tls, s) - var d uintptr = Xmalloc(tls, (l + uint64(1))) - if !(d != 0) { - return uintptr(0) - } - return Xmemcpy(tls, d, s, (l + uint64(1))) -} - func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */ bp := tls.Alloc(232) defer tls.Free(232) @@ -4232,6 +4264,15 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * return s } +func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + var l size_t = Xstrlen(tls, s) + var d uintptr = Xmalloc(tls, (l + uint64(1))) + if !(d != 0) { + return uintptr(0) + } + return Xmemcpy(tls, d, s, (l + uint64(1))) +} + func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ var l size_t = Xstrnlen(tls, d, n) if l == n { |