aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/cgo/main.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-11-30 12:45:38 +0100
committerAyke van Laethem <[email protected]>2018-12-10 15:38:03 +0100
commitc6069476a7d7f16bbd000004bf574a46d5d2222f (patch)
tree075a917dd973219f7845b93a148b94bbd1731f7e /testdata/cgo/main.go
parent0af7da9bff101070999cfe6a959f8c0791365243 (diff)
downloadtinygo-c6069476a7d7f16bbd000004bf574a46d5d2222f.tar.gz
tinygo-c6069476a7d7f16bbd000004bf574a46d5d2222f.zip
cgo: do not rely on stdint.h to be available
Diffstat (limited to 'testdata/cgo/main.go')
-rw-r--r--testdata/cgo/main.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/testdata/cgo/main.go b/testdata/cgo/main.go
index f37c95eb9..f4a5d4d8b 100644
--- a/testdata/cgo/main.go
+++ b/testdata/cgo/main.go
@@ -1,20 +1,20 @@
package main
/*
-#include <stdint.h>
-int32_t fortytwo(void);
-int32_t mul(int32_t a, int32_t b);
-typedef int32_t myint;
+int fortytwo(void);
+typedef short myint;
int add(int a, int b);
*/
import "C"
+import "unsafe"
+
func main() {
println("fortytwo:", C.fortytwo())
- println("mul:", C.mul(C.int32_t(3), 5))
println("add:", C.add(C.int(3), 5))
var x C.myint = 3
println("myint:", x, C.myint(5))
+ println("myint size:", int(unsafe.Sizeof(x)))
var y C.longlong = -(1 << 40)
println("longlong:", y)
}