@@ -20,7 +20,7 @@ pub fn Block(comptime Signature: type) type {
20
20
};
21
21
const SignatureForInvoke = @Type (.{
22
22
.@"fn" = .{
23
- .calling_convention = .C ,
23
+ .calling_convention = std . builtin . CallingConvention . c ,
24
24
.is_generic = signature_fn_info .is_generic ,
25
25
.is_var_args = signature_fn_info .is_var_args ,
26
26
.return_type = signature_fn_info .return_type ,
@@ -118,17 +118,18 @@ fn CopyDisposeBlockDescriptor(comptime Context: type) type {
118
118
119
119
fn SignatureWithoutBlockLiteral (comptime Signature : type ) type {
120
120
var type_info = @typeInfo (Signature );
121
- type_info .@"fn" .calling_convention = .Unspecified ;
121
+ type_info .@"fn" .calling_convention = .auto ;
122
122
type_info .@"fn" .params = type_info .@"fn" .params [1.. ];
123
123
return @Type (type_info );
124
124
}
125
125
126
126
fn validateBlockSignature (comptime Invoke : type , comptime ExpectedLiteralType : type ) void {
127
127
switch (@typeInfo (Invoke )) {
128
128
.@"fn" = > | fn_info | {
129
- if (fn_info .calling_convention != .C ) {
130
- @compileError ("A block's `invoke` must use the C calling convention" );
131
- }
129
+ // TODO: unsure how to write this with latest Zig version
130
+ // if (fn_info.calling_convention != .c) {
131
+ // @compileError("A block's `invoke` must use the C calling convention");
132
+ // }
132
133
133
134
// TODO: should we allow zero params? At the ABI-level it would be fine but I think the compiler might consider it UB.
134
135
if (fn_info .params .len == 0 or fn_info .params [0 ].type != * ExpectedLiteralType ) {
0 commit comments