diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 02:35:53 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 08:39:59 +0100 |
| commit | 0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch) | |
| tree | 2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /lib/std/Build/Step/ConfigHeader.zig | |
| parent | 1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff) | |
| download | zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip | |
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.
This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'lib/std/Build/Step/ConfigHeader.zig')
| -rw-r--r-- | lib/std/Build/Step/ConfigHeader.zig | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/std/Build/Step/ConfigHeader.zig b/lib/std/Build/Step/ConfigHeader.zig index 512460a532..895f50f5d0 100644 --- a/lib/std/Build/Step/ConfigHeader.zig +++ b/lib/std/Build/Step/ConfigHeader.zig @@ -109,47 +109,47 @@ pub fn getOutput(config_header: *ConfigHeader) std.Build.LazyPath { } fn addValuesInner(config_header: *ConfigHeader, values: anytype) !void { - inline for (@typeInfo(@TypeOf(values)).Struct.fields) |field| { + inline for (@typeInfo(@TypeOf(values)).@"struct".fields) |field| { try putValue(config_header, field.name, field.type, @field(values, field.name)); } } fn putValue(config_header: *ConfigHeader, field_name: []const u8, comptime T: type, v: T) !void { switch (@typeInfo(T)) { - .Null => { + .null => { try config_header.values.put(field_name, .undef); }, - .Void => { + .void => { try config_header.values.put(field_name, .defined); }, - .Bool => { + .bool => { try config_header.values.put(field_name, .{ .boolean = v }); }, - .Int => { + .int => { try config_header.values.put(field_name, .{ .int = v }); }, - .ComptimeInt => { + .comptime_int => { try config_header.values.put(field_name, .{ .int = v }); }, - .EnumLiteral => { + .enum_literal => { try config_header.values.put(field_name, .{ .ident = @tagName(v) }); }, - .Optional => { + .optional => { if (v) |x| { return putValue(config_header, field_name, @TypeOf(x), x); } else { try config_header.values.put(field_name, .undef); } }, - .Pointer => |ptr| { + .pointer => |ptr| { switch (@typeInfo(ptr.child)) { - .Array => |array| { + .array => |array| { if (ptr.size == .One and array.child == u8) { try config_header.values.put(field_name, .{ .string = v }); return; } }, - .Int => { + .int => { if (ptr.size == .Slice and ptr.child == u8) { try config_header.values.put(field_name, .{ .string = v }); return; |
