-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
The definitions in zig.zig to replace the HIWORD and LOWORD macros use pre-0.14.0 definition of Type. This causes
win32\zig.zig:288:10: error: no field named 'Int' in enum '@typeInfo(builtin.Type).@"union".tag_type.?'
.Int => |int| switch (int.signedness) {
~^~~
Relevent code in zig.zig:
pub fn loword(value: anytype) u16 {
switch (@typeInfo(@TypeOf(value))) {
.Int => |int| switch (int.signedness) {
.signed => return loword(@as(@Type(.{ .Int = .{ .signedness = .unsigned, .bits = int.bits } }), @bitCast(value))),
.unsigned => return if (int.bits <= 16) value else @intCast(0xffff & value),
},
else => {},
}
@compileError("unsupported type " ++ @typeName(@TypeOf(value)));
}
pub fn hiword(value: anytype) u16 {
switch (@typeInfo(@TypeOf(value))) {
.Int => |int| switch (int.signedness) {
.signed => return hiword(@as(@Type(.{ .Int = .{ .signedness = .unsigned, .bits = int.bits } }), @bitCast(value))),
.unsigned => return @intCast(0xffff & (value >> 16)),
},
else => {},
}
@compileError("unsupported type " ++ @typeName(@TypeOf(value)));
}
Metadata
Metadata
Assignees
Labels
No labels