mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Put ClientDllMap.cs behind #if fully
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user