Skip to content

Commit bb7ced8

Browse files
author
Stephen Gutekanst
committed
update to latest zig
Signed-off-by: Stephen Gutekanst <[email protected]>
1 parent 39adfe8 commit bb7ced8

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/objc.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ pub fn msgSend(receiver: anytype, comptime selector: []const u8, return_type: ty
8282
};
8383
for (@typeInfo(@TypeOf(args)).@"struct".fields) |field| {
8484
params = params ++
85-
.{.{
85+
[_]std.builtin.Type.Fn.Param{.{
8686
.is_generic = false,
8787
.is_noalias = false,
8888
.type = field.type,
8989
}};
9090
}
9191
break :init std.builtin.Type{
9292
.@"fn" = .{
93-
.calling_convention = .C,
93+
.calling_convention = std.builtin.CallingConvention.c,
9494
.is_generic = false,
9595
.is_var_args = false,
9696
.return_type = return_type,

src/system.zig

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn Block(comptime Signature: type) type {
2020
};
2121
const SignatureForInvoke = @Type(.{
2222
.@"fn" = .{
23-
.calling_convention = .C,
23+
.calling_convention = std.builtin.CallingConvention.c,
2424
.is_generic = signature_fn_info.is_generic,
2525
.is_var_args = signature_fn_info.is_var_args,
2626
.return_type = signature_fn_info.return_type,
@@ -118,17 +118,18 @@ fn CopyDisposeBlockDescriptor(comptime Context: type) type {
118118

119119
fn SignatureWithoutBlockLiteral(comptime Signature: type) type {
120120
var type_info = @typeInfo(Signature);
121-
type_info.@"fn".calling_convention = .Unspecified;
121+
type_info.@"fn".calling_convention = .auto;
122122
type_info.@"fn".params = type_info.@"fn".params[1..];
123123
return @Type(type_info);
124124
}
125125

126126
fn validateBlockSignature(comptime Invoke: type, comptime ExpectedLiteralType: type) void {
127127
switch (@typeInfo(Invoke)) {
128128
.@"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+
// }
132133

133134
// TODO: should we allow zero params? At the ABI-level it would be fine but I think the compiler might consider it UB.
134135
if (fn_info.params.len == 0 or fn_info.params[0].type != *ExpectedLiteralType) {

0 commit comments

Comments
 (0)