mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
Ensure the dynamic function has the same type as the static one
Co-authored-by: daurnimator <quae@daurnimator.com>
This commit is contained in:
parent
fcf3f61c28
commit
bbc2c7c268
@ -12,7 +12,7 @@ const unexpectedError = windows.unexpectedError;
|
||||
const GetLastError = windows.kernel32.GetLastError;
|
||||
const SetLastError = windows.kernel32.SetLastError;
|
||||
|
||||
fn selectSymbol(comptime function_static: anytype, function_dynamic: anytype, comptime os: std.Target.Os.WindowsVersion) @TypeOf(function_static) {
|
||||
fn selectSymbol(comptime function_static: anytype, function_dynamic: @TypeOf(function_static), comptime os: std.Target.Os.WindowsVersion) @TypeOf(function_static) {
|
||||
comptime {
|
||||
const sym_ok = builtin.Target.current.os.isAtLeast(.windows, os);
|
||||
if (sym_ok == true) return function_static;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user