Change Go types to simple unsafe Pointers instead of pointers
wrapped in structs. It could be possible to handle pointers to pointers now.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package main
|
||||
//go:generate nswrap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
InputFiles = [
|
||||
"/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h",
|
||||
# "/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h",
|
||||
# "/System/Library/Frameworks/Foundation.framework/Headers/NSString.h",
|
||||
]
|
||||
Classes = [
|
||||
"NSArray",
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
package main
|
||||
//go:generate nswrap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitlab.wow.st/gmp/nswrap/examples/simple/ClassOne"
|
||||
ns "gitlab.wow.st/gmp/nswrap/examples/simple/ClassOne"
|
||||
)
|
||||
|
||||
func main() {
|
||||
o := ClassOne.NewClassOne().Init()
|
||||
o := ns.NewClassOne().Init()
|
||||
fmt.Println("i1 = ",o.Geti1())
|
||||
fmt.Println("p1 = ",o.Getp1())
|
||||
p1 := o.Getp1()
|
||||
fmt.Println("*p1 = ", *p1)
|
||||
*p1 = 17
|
||||
fmt.Println("*p1 = ", *o.Getp1())
|
||||
ns := o.Nstru1()
|
||||
ns1 := o.Nstru1()
|
||||
np := o.Nstru2()
|
||||
fmt.Println(o.Hi1(ns))
|
||||
fmt.Println(o.Hi1(ns1))
|
||||
fmt.Println(o.Hi2(np))
|
||||
o2 := ns.NewClassTwo().Init()
|
||||
fmt.Println(o2.Hi1(ns1))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user