aboutsummaryrefslogtreecommitdiffhomepage
path: root/cgo/libclang_stubs.c
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2019-05-16 22:16:58 +0200
committerRon Evans <[email protected]>2019-05-17 19:37:20 +0200
commitdfa713040a7b3be012dc229996440005734aa9b4 (patch)
treeb9e6085df2788c1c10e792739ea6d79b7adf2aa8 /cgo/libclang_stubs.c
parent82dc14b74174bc5114271773d6eb7d3858ad862d (diff)
downloadtinygo-dfa713040a7b3be012dc229996440005734aa9b4.tar.gz
tinygo-dfa713040a7b3be012dc229996440005734aa9b4.zip
cgo: add support for enum types
Enum types are implemented as named types (with possible accompanying typedefs as type aliases). The constants inside the enums are treated as Go constants like in the Go toolchain.
Diffstat (limited to 'cgo/libclang_stubs.c')
-rw-r--r--cgo/libclang_stubs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cgo/libclang_stubs.c b/cgo/libclang_stubs.c
index c282540a4..0ccfd4ab1 100644
--- a/cgo/libclang_stubs.c
+++ b/cgo/libclang_stubs.c
@@ -56,3 +56,11 @@ CXSourceRange tinygo_clang_getCursorExtent(CXCursor c) {
CXTranslationUnit tinygo_clang_Cursor_getTranslationUnit(CXCursor c) {
return clang_Cursor_getTranslationUnit(c);
}
+
+long long tinygo_clang_getEnumConstantDeclValue(CXCursor c) {
+ return clang_getEnumConstantDeclValue(c);
+}
+
+CXType tinygo_clang_getEnumDeclIntegerType(CXCursor c) {
+ return clang_getEnumDeclIntegerType(c);
+}