| ... | @@ -403,22 +403,26 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E | ... | @@ -403,22 +403,26 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 403 | | 403 | |
| 404 | switch (fn_type.getTypeClass()) { | 404 | switch (fn_type.getTypeClass()) { |
| 405 | .Attributed => { | 405 | .Attributed => { |
| 406 | const attr_type = @as(*const clang.AttributedType, @ptrCast(fn_type)); | 406 | const attr_type: *const clang.AttributedType = @ptrCast(fn_type); |
| 407 | fn_qt = attr_type.getEquivalentType(); | 407 | fn_qt = attr_type.getEquivalentType(); |
| 408 | }, | 408 | }, |
| 409 | .Paren => { | 409 | .Paren => { |
| 410 | const paren_type = @as(*const clang.ParenType, @ptrCast(fn_type)); | 410 | const paren_type: *const clang.ParenType = @ptrCast(fn_type); |
| 411 | fn_qt = paren_type.getInnerType(); | 411 | fn_qt = paren_type.getInnerType(); |
| 412 | }, | 412 | }, |
| | 413 | .MacroQualified => { |
| | 414 | const macroqualified_ty: *const clang.MacroQualifiedType = @ptrCast(fn_type); |
| | 415 | fn_qt = macroqualified_ty.getModifiedType(); |
| | 416 | }, |
| 413 | else => break fn_type, | 417 | else => break fn_type, |
| 414 | } | 418 | } |
| 415 | }; | 419 | }; |
| 416 | const fn_ty = @as(*const clang.FunctionType, @ptrCast(fn_type)); | 420 | const fn_ty: *const clang.FunctionType = @ptrCast(fn_type); |
| 417 | const return_qt = fn_ty.getReturnType(); | 421 | const return_qt = fn_ty.getReturnType(); |
| 418 | | 422 | |
| 419 | const proto_node = switch (fn_type.getTypeClass()) { | 423 | const proto_node = switch (fn_type.getTypeClass()) { |
| 420 | .FunctionProto => blk: { | 424 | .FunctionProto => blk: { |
| 421 | const fn_proto_type = @as(*const clang.FunctionProtoType, @ptrCast(fn_type)); | 425 | const fn_proto_type: *const clang.FunctionProtoType = @ptrCast(fn_type); |
| 422 | if (has_body and fn_proto_type.isVariadic()) { | 426 | if (has_body and fn_proto_type.isVariadic()) { |
| 423 | decl_ctx.has_body = false; | 427 | decl_ctx.has_body = false; |
| 424 | decl_ctx.storage_class = .Extern; | 428 | decl_ctx.storage_class = .Extern; |
| ... | @@ -434,7 +438,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E | ... | @@ -434,7 +438,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 434 | }; | 438 | }; |
| 435 | }, | 439 | }, |
| 436 | .FunctionNoProto => blk: { | 440 | .FunctionNoProto => blk: { |
| 437 | const fn_no_proto_type = @as(*const clang.FunctionType, @ptrCast(fn_type)); | 441 | const fn_no_proto_type: *const clang.FunctionType = @ptrCast(fn_type); |
| 438 | break :blk transFnNoProto(c, fn_no_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { | 442 | break :blk transFnNoProto(c, fn_no_proto_type, fn_decl_loc, decl_ctx, true) catch |err| switch (err) { |
| 439 | error.UnsupportedType => { | 443 | error.UnsupportedType => { |
| 440 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); | 444 | return failDecl(c, fn_decl_loc, fn_name, "unable to resolve prototype of function", .{}); |
| ... | @@ -490,7 +494,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E | ... | @@ -490,7 +494,7 @@ fn transFnDecl(c: *Context, scope: *Scope, fn_decl: *const clang.FunctionDecl) E |
| 490 | param_id += 1; | 494 | param_id += 1; |
| 491 | } | 495 | } |
| 492 | | 496 | |
| 493 | const casted_body = @as(*const clang.CompoundStmt, @ptrCast(body_stmt)); | 497 | const casted_body: *const clang.CompoundStmt = @ptrCast(body_stmt); |
| 494 | transCompoundStmtInline(c, casted_body, &block_scope) catch |err| switch (err) { | 498 | transCompoundStmtInline(c, casted_body, &block_scope) catch |err| switch (err) { |
| 495 | error.OutOfMemory => |e| return e, | 499 | error.OutOfMemory => |e| return e, |
| 496 | error.UnsupportedTranslation, | 500 | error.UnsupportedTranslation, |