diff options
author | leongross <[email protected]> | 2024-09-17 07:12:57 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-17 16:12:57 +0200 |
commit | a9bf981d9219ad894c39d5dddce517708f7d0be5 (patch) | |
tree | 04982af928a5dd4d080416cd5581601291ee23c6 /cgo/testdata | |
parent | d4729f92bde874dac83c07d96538dba90fd716d3 (diff) | |
download | tinygo-a9bf981d9219ad894c39d5dddce517708f7d0be5.tar.gz tinygo-a9bf981d9219ad894c39d5dddce517708f7d0be5.zip |
Cgo add cbytes implementation (rebased version of #3318) (#4470)
cgo: added CBytes implementation
Diffstat (limited to 'cgo/testdata')
-rw-r--r-- | cgo/testdata/basic.out.go | 7 | ||||
-rw-r--r-- | cgo/testdata/const.out.go | 7 | ||||
-rw-r--r-- | cgo/testdata/errors.out.go | 7 | ||||
-rw-r--r-- | cgo/testdata/flags.out.go | 7 | ||||
-rw-r--r-- | cgo/testdata/symbols.out.go | 7 | ||||
-rw-r--r-- | cgo/testdata/types.out.go | 7 |
6 files changed, 42 insertions, 0 deletions
diff --git a/cgo/testdata/basic.out.go b/cgo/testdata/basic.out.go index f2daa78da..6c2623980 100644 --- a/cgo/testdata/basic.out.go +++ b/cgo/testdata/basic.out.go @@ -24,6 +24,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 diff --git a/cgo/testdata/const.out.go b/cgo/testdata/const.out.go index 4a5f5fd5b..2b48163b4 100644 --- a/cgo/testdata/const.out.go +++ b/cgo/testdata/const.out.go @@ -24,6 +24,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 diff --git a/cgo/testdata/errors.out.go b/cgo/testdata/errors.out.go index d0e04320a..43a6a65c9 100644 --- a/cgo/testdata/errors.out.go +++ b/cgo/testdata/errors.out.go @@ -44,6 +44,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 diff --git a/cgo/testdata/flags.out.go b/cgo/testdata/flags.out.go index 72520ab6d..83ca60420 100644 --- a/cgo/testdata/flags.out.go +++ b/cgo/testdata/flags.out.go @@ -29,6 +29,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 diff --git a/cgo/testdata/symbols.out.go b/cgo/testdata/symbols.out.go index f2826ae2e..569cb65f6 100644 --- a/cgo/testdata/symbols.out.go +++ b/cgo/testdata/symbols.out.go @@ -24,6 +24,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 diff --git a/cgo/testdata/types.out.go b/cgo/testdata/types.out.go index a35d3733c..e5382ec80 100644 --- a/cgo/testdata/types.out.go +++ b/cgo/testdata/types.out.go @@ -24,6 +24,13 @@ func C.GoBytes(ptr unsafe.Pointer, length C.int) []byte { return C.__GoBytes(ptr, uintptr(length)) } +//go:linkname C.__CBytes runtime.cgo_CBytes +func C.__CBytes([]byte) unsafe.Pointer + +func C.CBytes(b []byte) unsafe.Pointer { + return C.__CBytes(b) +} + type ( C.char uint8 C.schar int8 |