diff options
author | Ayke van Laethem <[email protected]> | 2019-04-28 14:10:03 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-05-12 10:49:15 +0200 |
commit | 99587fe0731e6a80b2485eaca5657e6bd43cb9be (patch) | |
tree | 8d47af4cfdd91b0b50700510bd04539a09b8f769 /testdata/cgo/main.go | |
parent | eb0ce8a29897b6faa1d28ba80006f625dc0b2435 (diff) | |
download | tinygo-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.go | 4 |
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) |