aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/cgo/main.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2019-04-28 14:10:03 +0200
committerRon Evans <[email protected]>2019-05-12 10:49:15 +0200
commit99587fe0731e6a80b2485eaca5657e6bd43cb9be (patch)
tree8d47af4cfdd91b0b50700510bd04539a09b8f769 /testdata/cgo/main.go
parenteb0ce8a29897b6faa1d28ba80006f625dc0b2435 (diff)
downloadtinygo-99587fe0731e6a80b2485eaca5657e6bd43cb9be.tar.gz
tinygo-99587fe0731e6a80b2485eaca5657e6bd43cb9be.zip
cgo: add support for #define constants
These are converted to Go constants where possible.
Diffstat (limited to 'testdata/cgo/main.go')
-rw-r--r--testdata/cgo/main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/testdata/cgo/main.go b/testdata/cgo/main.go
index 3e444f4b9..7a434855b 100644
--- a/testdata/cgo/main.go
+++ b/testdata/cgo/main.go
@@ -18,6 +18,10 @@ func main() {
var y C.longlong = -(1 << 40)
println("longlong:", y)
println("global:", C.global)
+ println("defined ints:", C.CONST_INT, C.CONST_INT2)
+ println("defined floats:", C.CONST_FLOAT, C.CONST_FLOAT2)
+ println("defined string:", C.CONST_STRING)
+ println("defined char:", C.CONST_CHAR)
var ptr C.intPointer
var n C.int = 15
ptr = C.intPointer(&n)