Fixed Windows x86 build crash

This commit is contained in:
Yaroslav Lahin 2018-12-04 11:31:58 +03:00
parent 96511dcc64
commit c0a6a80089

View File

@ -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.
///
/// </summary>
public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows;
public static bool UseThisCall { get; set; } = true;
/// <summary>