Fix export & handle unsafe.pointer types
This commit is contained in:
parent
b8d64cbb1e
commit
de698e64a3
|
@ -2,15 +2,14 @@ package main
|
|||
|
||||
const prelude = `package main
|
||||
// #include <stdlib.h>
|
||||
import (
|
||||
"C"
|
||||
mobile "github.com/status-im/status-go/mobile"
|
||||
)
|
||||
import "C"
|
||||
import "unsafe"
|
||||
import mobile "github.com/status-im/status-go/mobile"
|
||||
|
||||
func main() {}
|
||||
`
|
||||
|
||||
const intType = "int"
|
||||
const stringType = "string"
|
||||
const unsafePointerType = "unsafe.Pointer"
|
||||
const unsafePointerType = "&{unsafe Pointer}"
|
||||
const boolType = "bool"
|
||||
|
|
|
@ -56,6 +56,8 @@ func handleFunction(name string, funcDecl *ast.FuncDecl) string {
|
|||
output += paramIdentity.Name
|
||||
|
||||
typeString := fmt.Sprint(paramIdentity.Obj.Decl.(*ast.Field).Type)
|
||||
// We match against the stringified type,
|
||||
// could not find a better way to match this
|
||||
switch typeString {
|
||||
case stringType:
|
||||
output += " *C.char"
|
||||
|
|
Loading…
Reference in New Issue