{frreetype,sysaudio}: use std.refAllDeclsRecursive

added to stdlib via #12103
This commit is contained in:
alichraghi 2022-07-17 12:36:22 +04:30 committed by Stephen Gutekanst
parent 0ff83ba517
commit be9d2b431f
4 changed files with 23 additions and 51 deletions

View file

@ -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);
}
}
}