From dfda85e870df1b0620c418940db3b946fdd3d620 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 9 Dec 2015 01:03:04 -0700 Subject: ability to call external variadic functions --- src/parseh.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/parseh.cpp') 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; } -- cgit v1.2.3