From c0a6a80089755a5d6f929aef864bf59cf30dcdd6 Mon Sep 17 00:00:00 2001 From: Yaroslav Lahin Date: Tue, 4 Dec 2018 11:31:58 +0300 Subject: [PATCH] Fixed Windows x86 build crash --- Facepunch.Steamworks/Config.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index f512bc1..48b93a0 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace Facepunch.Steamworks { @@ -18,6 +15,11 @@ public static void ForUnity( string platform ) // if ( platform == "WindowsEditor" || platform == "WindowsPlayer" ) { + // + // 32bit windows unity uses a stdcall + // + if (IntPtr.Size == 4) UseThisCall = false; + ForcePlatform( OperatingSystem.Windows, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); } @@ -31,8 +33,6 @@ public static void ForUnity( string platform ) ForcePlatform( OperatingSystem.Linux, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); } - UseThisCall = true; - Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch ); @@ -47,7 +47,7 @@ public static void ForUnity( string platform ) /// for releasing his shit open source under the MIT license so we can all learn and iterate. /// /// - public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows; + public static bool UseThisCall { get; set; } = true; ///