authorgravatar for hemisputnik@proton.mehemisputnik <hemisputnik@proton.me> 2026-08-09 11:12:22+03:00
committergravatar for hemisputnik@proton.mehemisputnik <hemisputnik@proton.me> 2026-08-10 11:17:07+03:00
log27bf90f12b70c427411779c4fed99a6288c43710
tree52a146c4f7d69091db8fbf34492feb43fb792a14
parentaf6ee1a799bf01d55a36717999be1caf22fa8000
signaturebadge-check Signed by SSH key SHA256:iUK/EffQPyeXTXChJNV0UrxsscinNLxnk+0pu4OGU7Q

std.Build.Configuration: use IndexType where appropriate


1 files changed, 7 insertions(+), 49 deletions(-)

lib/std/Build/Configuration.zig+7-49
...@@ -1515,13 +1515,7 @@ pub const LazyPath = union(@This().Tag) {...@@ -1515,13 +1515,7 @@ pub const LazyPath = union(@This().Tag) {
1515 };1515 };
15161516
1517 /// An index into `extra`.1517 /// An index into `extra`.
1518 pub const Index = enum(u32) {1518 pub const Index = IndexType(@This());
1519 _,
1520
1521 pub fn get(this: @This(), c: *const Configuration) LazyPath {
1522 return extraData(c, LazyPath, @backingInt(this));
1523 }
1524 };
15251519
1526 /// An index into `extra`, or `null`.1520 /// An index into `extra`, or `null`.
1527 pub const OptionalIndex = enum(u32) {1521 pub const OptionalIndex = enum(u32) {
...@@ -1746,13 +1740,7 @@ pub const Module = struct {...@@ -1746,13 +1740,7 @@ pub const Module = struct {
1746 }1740 }
1747 };1741 };
17481742
1749 pub const Index = enum(u32) {1743 pub const Index = IndexType(@This());
1750 _,
1751
1752 pub fn get(this: @This(), c: *const Configuration) Module {
1753 return extraData(c, Module, @backingInt(this));
1754 }
1755 };
17561744
1757 pub const Flags = packed struct(u32) {1745 pub const Flags = packed struct(u32) {
1758 optimize: Optimize,1746 optimize: Optimize,
...@@ -2051,13 +2039,7 @@ pub const SystemLib = struct {...@@ -2051,13 +2039,7 @@ pub const SystemLib = struct {
2051 name: String,2039 name: String,
2052 flags: Flags,2040 flags: Flags,
20532041
2054 pub const Index = enum(u32) {2042 pub const Index = IndexType(@This());
2055 _,
2056
2057 pub fn get(this: @This(), c: *const Configuration) SystemLib {
2058 return extraData(c, SystemLib, @backingInt(this));
2059 }
2060 };
20612043
2062 pub const UsePkgConfig = enum(u2) {2044 pub const UsePkgConfig = enum(u2) {
2063 /// Don't use pkg-config, just pass -lfoo where foo is name.2045 /// Don't use pkg-config, just pass -lfoo where foo is name.
...@@ -2090,13 +2072,7 @@ pub const CSourceFiles = struct {...@@ -2090,13 +2072,7 @@ pub const CSourceFiles = struct {
2090 args: Storage.FlagList(.flags, .args_len, String),2072 args: Storage.FlagList(.flags, .args_len, String),
2091 sub_paths: Storage.LengthPrefixedList(String),2073 sub_paths: Storage.LengthPrefixedList(String),
20922074
2093 pub const Index = enum(u32) {2075 pub const Index = IndexType(@This());
2094 _,
2095
2096 pub fn get(this: @This(), c: *const Configuration) CSourceFiles {
2097 return extraData(c, CSourceFiles, @backingInt(this));
2098 }
2099 };
21002076
2101 pub const Flags = packed struct(u32) {2077 pub const Flags = packed struct(u32) {
2102 /// C compiler CLI flags.2078 /// C compiler CLI flags.
...@@ -2110,13 +2086,7 @@ pub const CSourceFile = struct {...@@ -2110,13 +2086,7 @@ pub const CSourceFile = struct {
2110 file: LazyPath.Index,2086 file: LazyPath.Index,
2111 args: Storage.FlagList(.flags, .args_len, String),2087 args: Storage.FlagList(.flags, .args_len, String),
21122088
2113 pub const Index = enum(u32) {2089 pub const Index = IndexType(@This());
2114 _,
2115
2116 pub fn get(this: @This(), c: *const Configuration) CSourceFile {
2117 return extraData(c, CSourceFile, @backingInt(this));
2118 }
2119 };
21202090
2121 pub const Flags = packed struct(u32) {2091 pub const Flags = packed struct(u32) {
2122 /// C compiler CLI flags.2092 /// C compiler CLI flags.
...@@ -2131,13 +2101,7 @@ pub const RcSourceFile = struct {...@@ -2131,13 +2101,7 @@ pub const RcSourceFile = struct {
2131 args: Storage.FlagList(.flags, .args_len, String),2101 args: Storage.FlagList(.flags, .args_len, String),
2132 include_paths: Storage.FlagLengthPrefixedList(.flags, .include_paths, LazyPath.Index),2102 include_paths: Storage.FlagLengthPrefixedList(.flags, .include_paths, LazyPath.Index),
21332103
2134 pub const Index = enum(u32) {2104 pub const Index = IndexType(@This());
2135 _,
2136
2137 pub fn get(this: @This(), c: *const Configuration) RcSourceFile {
2138 return extraData(c, RcSourceFile, @backingInt(this));
2139 }
2140 };
21412105
2142 pub const Flags = packed struct(u32) {2106 pub const Flags = packed struct(u32) {
2143 /// C compiler CLI flags.2107 /// C compiler CLI flags.
...@@ -2176,13 +2140,7 @@ pub const ResolvedTarget = struct {...@@ -2176,13 +2140,7 @@ pub const ResolvedTarget = struct {
2176 /// defaults will be resolved.2140 /// defaults will be resolved.
2177 result: TargetQuery.Index,2141 result: TargetQuery.Index,
21782142
2179 pub const Index = enum(u32) {2143 pub const Index = IndexType(@This());
2180 _,
2181
2182 pub fn get(this: @This(), c: *const Configuration) ResolvedTarget {
2183 return extraData(c, ResolvedTarget, @backingInt(this));
2184 }
2185 };
21862144
2187 pub const OptionalIndex = enum(u32) {2145 pub const OptionalIndex = enum(u32) {
2188 none = max_u32,2146 none = max_u32,