We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c53ef1 commit b615174Copy full SHA for b615174
src/root.zig
@@ -50,9 +50,16 @@ comptime {
50
}
51
52
53
+fn panicLocateFunction(name: []const u8) noreturn {
54
+ @branchHint(.cold);
55
+ std.debug.panic("Failed to locate function {s}", .{name});
56
+}
57
+
58
fn loadFunctions(dll: std.os.windows.HMODULE) void {
59
inline for (comptime std.meta.fieldNames(ProxyFuncAddrs)) |field| {
- @field(proxy_func_addrs, field) = std.os.windows.kernel32.GetProcAddress(dll, field).?;
60
+ @field(proxy_func_addrs, field) = std.os.windows.kernel32.GetProcAddress(dll, field) orelse {
61
+ panicLocateFunction(field);
62
+ };
63
64
65
0 commit comments