diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2015-12-09 01:03:04 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2015-12-09 01:03:04 -0700 |
| commit | dfda85e870df1b0620c418940db3b946fdd3d620 (patch) | |
| tree | 94d4d7e158f62ee2cd153b002165bc3ef7aa7c47 /src/parseh.cpp | |
| parent | 4eff5f114b463ddd887665129f2e1d29b0f13b7f (diff) | |
| download | zig-dfda85e870df1b0620c418940db3b946fdd3d620.tar.gz zig-dfda85e870df1b0620c418940db3b946fdd3d620.zip | |
ability to call external variadic functions
Diffstat (limited to 'src/parseh.cpp')
| -rw-r--r-- | src/parseh.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/parseh.cpp b/src/parseh.cpp index b69f85b8ae..40c317d5d8 100644 --- a/src/parseh.cpp +++ b/src/parseh.cpp @@ -132,10 +132,10 @@ static bool resolves_to_void(ParseH *p, CXType raw_type) { static Buf *to_zig_type(ParseH *p, CXType raw_type) { if (raw_type.kind == CXType_Unexposed) { CXType canonical = clang_getCanonicalType(raw_type); - if (canonical.kind != CXType_Unexposed) - return to_zig_type(p, canonical); - else + if (canonical.kind == CXType_Unexposed) zig_panic("clang C api insufficient"); + else + return to_zig_type(p, canonical); } switch (raw_type.kind) { case CXType_Invalid: @@ -453,6 +453,10 @@ static enum CXChildVisitResult fn_visitor(CXCursor cursor, CXCursor parent, CXCl } else if (underlying_type.kind == CXType_Record) { CXCursor decl_cursor = clang_getTypeDeclaration(underlying_type); skip_typedef = handle_struct_cursor(p, decl_cursor, clang_getCString(name), false); + } else if (underlying_type.kind == CXType_Invalid) { + fprintf(stderr, "warning: invalid type\n"); + print_location(p); + skip_typedef = true; } else { skip_typedef = false; } |
