cgo: add support for C.CString and related functions

This commit is contained in:
Ayke van Laethem
2021-11-11 16:11:08 +01:00
committed by Ron Evans
parent 6bd18af5ef
commit c31aef06ba
14 changed files with 238 additions and 3 deletions
+3
View File
@@ -42,6 +42,9 @@ func memzero(ptr unsafe.Pointer, size uintptr)
//export strlen
func strlen(ptr unsafe.Pointer) uintptr
//export malloc
func malloc(size uintptr) unsafe.Pointer
// Compare two same-size buffers for equality.
func memequal(x, y unsafe.Pointer, n uintptr) bool {
for i := uintptr(0); i < n; i++ {