diff --git a/Robust.Client/Utility/ClientDllMap.cs b/Robust.Client/Utility/ClientDllMap.cs index 00bd9ab52..963579ec8 100644 --- a/Robust.Client/Utility/ClientDllMap.cs +++ b/Robust.Client/Utility/ClientDllMap.cs @@ -1,4 +1,5 @@ -using System; +#if !WINDOWS +using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SDL3; @@ -10,28 +11,22 @@ namespace Robust.Client.Utility [ModuleInitializer] internal static void Initialize() { - if (OperatingSystem.IsWindows()) - return; - NativeLibrary.SetDllImportResolver(typeof(ClientDllMap).Assembly, (name, assembly, path) => { if (name == "swnfd.dll") { - if (OperatingSystem.IsLinux()) - return NativeLibrary.Load("libswnfd.so", assembly, path); - - if (OperatingSystem.IsMacOS()) - return NativeLibrary.Load("libswnfd.dylib", assembly, path); - - return IntPtr.Zero; +#if LINUX || FREEBSD + return NativeLibrary.Load("libswnfd.so", assembly, path); +#elif MACOS + return NativeLibrary.Load("libswnfd.dylib", assembly, path); +#endif } if (name == "libEGL.dll") { - if (OperatingSystem.IsLinux()) - return NativeLibrary.Load("libEGL.so", assembly, path); - - return IntPtr.Zero; +#if LINUX || FREEBSD + return NativeLibrary.Load("libEGL.so", assembly, path); +#endif } if (name == SDL.nativeLibName) @@ -48,3 +43,4 @@ namespace Robust.Client.Utility } } } +#endif