From 31abef172a4db98c6917ff9de064225c500cb275 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 4 Feb 2018 22:13:21 -0500 Subject: [PATCH] fix accidentally linking against kernel32 on non windows --- std/os/windows/util.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/std/os/windows/util.zig b/std/os/windows/util.zig index d03092ff14..2569763489 100644 --- a/std/os/windows/util.zig +++ b/std/os/windows/util.zig @@ -1,4 +1,5 @@ const std = @import("../../index.zig"); +const builtin = @import("builtin"); const os = std.os; const windows = std.os.windows; const assert = std.debug.assert; @@ -170,6 +171,8 @@ pub fn windowsUnloadDll(hModule: windows.HMODULE) void { test "InvalidDll" { + if (builtin.os != builtin.Os.windows) return; + const DllName = "asdf.dll"; const allocator = std.debug.global_allocator; const handle = os.windowsLoadDll(allocator, DllName) catch |err| {