{frreetype,sysaudio}: use std.refAllDeclsRecursive
added to stdlib via #12103
This commit is contained in:
parent
0ff83ba517
commit
be9d2b431f
4 changed files with 23 additions and 51 deletions
|
|
@ -19,18 +19,3 @@ pub fn bitFieldsToStruct(comptime StructType: type, comptime EnumDataType: type,
|
|||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
pub fn refAllDecls(comptime T: type) void {
|
||||
@setEvalBranchQuota(10000);
|
||||
inline for (comptime std.meta.declarations(T)) |decl| {
|
||||
if (decl.is_pub) {
|
||||
if (@TypeOf(@field(T, decl.name)) == type) {
|
||||
switch (@typeInfo(@field(T, decl.name))) {
|
||||
.Struct, .Enum, .Union, .Opaque => refAllDecls(@field(T, decl.name)),
|
||||
else => {},
|
||||
}
|
||||
}
|
||||
_ = @field(T, decl.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue