build: update to Zig 0.12

This commit is contained in:
Isaac Freund
2024-03-07 16:19:22 +01:00
parent 680cb8ef69
commit 033cad47bf
51 changed files with 285 additions and 271 deletions

View File

@ -18,7 +18,7 @@ const std = @import("std");
const mem = std.mem;
pub const Flag = struct {
name: []const u8,
name: [:0]const u8,
kind: enum { boolean, arg },
};
@ -37,7 +37,7 @@ pub fn parser(comptime Arg: type, comptime flags: []const Flag) type {
pub const Flags = flags_type: {
var fields: []const std.builtin.Type.StructField = &.{};
inline for (flags) |flag| {
for (flags) |flag| {
const field: std.builtin.Type.StructField = switch (flag.kind) {
.boolean => .{
.name = flag.name,
@ -57,7 +57,7 @@ pub fn parser(comptime Arg: type, comptime flags: []const Flag) type {
fields = fields ++ [_]std.builtin.Type.StructField{field};
}
break :flags_type @Type(.{ .Struct = .{
.layout = .Auto,
.layout = .auto,
.fields = fields,
.decls = &.{},
.is_tuple = false,