From ed5b8335b564cc4372b12e1c1a1b459aa348a90d Mon Sep 17 00:00:00 2001 From: hryx Date: Sat, 8 Jun 2019 16:09:25 -0700 Subject: [PATCH] (broken) translate Paren type --- src-self-hosted/translate_c.zig | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src-self-hosted/translate_c.zig b/src-self-hosted/translate_c.zig index 459f90ad97..7e1c6571e2 100644 --- a/src-self-hosted/translate_c.zig +++ b/src-self-hosted/translate_c.zig @@ -847,6 +847,15 @@ fn transType(rp: RestorePoint, ty: *const ZigClangType, source_loc: ZigClangSour else => return revertAndWarn(rp, error.UnsupportedType, source_loc, "unsupported builtin type"), } }, + .FunctionProto => { + const fn_proto_ty = @ptrCast(*const ZigClangFunctionProtoType, ty); + const fn_proto = try transFnProto(rp, fn_proto_ty, source_loc, null); + return &fn_proto.base; + }, + .Paren => { + const paren_ty = @ptrCast(*const ZigClangParenType, ty); + return transQualType(rp, ZigClangParenType_getInnerType(paren_ty), source_loc); + }, .Pointer => { const child_qt = ZigClangType_getPointeeType(ty); const child_node = try transQualType(rp, child_qt, source_loc); @@ -870,11 +879,6 @@ fn transType(rp: RestorePoint, ty: *const ZigClangType, source_loc: ZigClangSour .BracketStarCBracket, ); }, - .FunctionProto => { - const fn_proto_ty = @ptrCast(*const ZigClangFunctionProtoType, ty); - const fn_proto = try transFnProto(rp, fn_proto_ty, source_loc, null); - return &fn_proto.base; - }, else => { const type_name = rp.c.str(ZigClangType_getTypeClassName(ty)); return revertAndWarn(rp, error.UnsupportedType, source_loc, "unsupported type: '{}'", type_name);