mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
cgo: implement void* pointer type
void* is translated to unsafe.Pointer on the Go side.
This commit is contained in:
committed by
Ron Evans
parent
9c46ac4eed
commit
b815d3f760
Vendored
+2
@@ -41,6 +41,8 @@ func main() {
|
||||
println("complex double:", C.globalComplexDouble)
|
||||
println("complex long double:", C.globalComplexLongDouble)
|
||||
println("char match:", C.globalChar == 100)
|
||||
var voidPtr unsafe.Pointer = C.globalVoidPtrNull
|
||||
println("void* match:", voidPtr == nil, C.globalVoidPtrNull == nil, (*C.int)(C.globalVoidPtrSet) == &C.global)
|
||||
|
||||
// complex types
|
||||
println("struct:", C.int(unsafe.Sizeof(C.globalStruct)) == C.globalStructSize, C.globalStruct.s, C.globalStruct.l, C.globalStruct.f)
|
||||
|
||||
Reference in New Issue
Block a user