Handle struct returns differently on 32bit windows too

This commit is contained in:
Garry Newman 2019-06-25 12:42:17 +01:00
parent a24ae4bac5
commit 7fbc333547
7 changed files with 34 additions and 34 deletions

View File

@ -311,7 +311,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetAppOwner( IntPtr self, ref SteamId retVal ); private delegate void FGetAppOwner( IntPtr self, ref SteamId retVal );
#else #else
private delegate SteamId FGetAppOwner( IntPtr self ); private delegate SteamId FGetAppOwner( IntPtr self );
@ -321,7 +321,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetAppOwner() internal SteamId GetAppOwner()
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetAppOwner( Self, ref retVal ); _GetAppOwner( Self, ref retVal );
return retVal; return retVal;

View File

@ -394,7 +394,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetClanByIndex( IntPtr self, ref SteamId retVal, int iClan ); private delegate void FGetClanByIndex( IntPtr self, ref SteamId retVal, int iClan );
#else #else
private delegate SteamId FGetClanByIndex( IntPtr self, int iClan ); private delegate SteamId FGetClanByIndex( IntPtr self, int iClan );
@ -404,7 +404,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetClanByIndex( int iClan ) internal SteamId GetClanByIndex( int iClan )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetClanByIndex( Self, ref retVal, iClan ); _GetClanByIndex( Self, ref retVal, iClan );
return retVal; return retVal;
@ -473,7 +473,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetFriendFromSourceByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDSource, int iFriend ); private delegate void FGetFriendFromSourceByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDSource, int iFriend );
#else #else
private delegate SteamId FGetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend ); private delegate SteamId FGetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend );
@ -483,7 +483,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetFriendFromSourceByIndex( SteamId steamIDSource, int iFriend ) internal SteamId GetFriendFromSourceByIndex( SteamId steamIDSource, int iFriend )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetFriendFromSourceByIndex( Self, ref retVal, steamIDSource, iFriend ); _GetFriendFromSourceByIndex( Self, ref retVal, steamIDSource, iFriend );
return retVal; return retVal;
@ -639,7 +639,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetClanOwner( IntPtr self, ref SteamId retVal, SteamId steamIDClan ); private delegate void FGetClanOwner( IntPtr self, ref SteamId retVal, SteamId steamIDClan );
#else #else
private delegate SteamId FGetClanOwner( IntPtr self, SteamId steamIDClan ); private delegate SteamId FGetClanOwner( IntPtr self, SteamId steamIDClan );
@ -649,7 +649,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetClanOwner( SteamId steamIDClan ) internal SteamId GetClanOwner( SteamId steamIDClan )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetClanOwner( Self, ref retVal, steamIDClan ); _GetClanOwner( Self, ref retVal, steamIDClan );
return retVal; return retVal;
@ -671,7 +671,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetClanOfficerByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iOfficer ); private delegate void FGetClanOfficerByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iOfficer );
#else #else
private delegate SteamId FGetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer ); private delegate SteamId FGetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer );
@ -681,7 +681,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetClanOfficerByIndex( SteamId steamIDClan, int iOfficer ) internal SteamId GetClanOfficerByIndex( SteamId steamIDClan, int iOfficer )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetClanOfficerByIndex( Self, ref retVal, steamIDClan, iOfficer ); _GetClanOfficerByIndex( Self, ref retVal, steamIDClan, iOfficer );
return retVal; return retVal;
@ -795,7 +795,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetCoplayFriend( IntPtr self, ref SteamId retVal, int iCoplayFriend ); private delegate void FGetCoplayFriend( IntPtr self, ref SteamId retVal, int iCoplayFriend );
#else #else
private delegate SteamId FGetCoplayFriend( IntPtr self, int iCoplayFriend ); private delegate SteamId FGetCoplayFriend( IntPtr self, int iCoplayFriend );
@ -805,7 +805,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetCoplayFriend( int iCoplayFriend ) internal SteamId GetCoplayFriend( int iCoplayFriend )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetCoplayFriend( Self, ref retVal, iCoplayFriend ); _GetCoplayFriend( Self, ref retVal, iCoplayFriend );
return retVal; return retVal;
@ -872,7 +872,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetChatMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iUser ); private delegate void FGetChatMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iUser );
#else #else
private delegate SteamId FGetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser ); private delegate SteamId FGetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser );
@ -882,7 +882,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetChatMemberByIndex( SteamId steamIDClan, int iUser ) internal SteamId GetChatMemberByIndex( SteamId steamIDClan, int iUser )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetChatMemberByIndex( Self, ref retVal, steamIDClan, iUser ); _GetChatMemberByIndex( Self, ref retVal, steamIDClan, iUser );
return retVal; return retVal;

View File

@ -223,7 +223,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); private delegate void FGetSteamID( IntPtr self, ref SteamId retVal );
#else #else
private delegate SteamId FGetSteamID( IntPtr self ); private delegate SteamId FGetSteamID( IntPtr self );
@ -233,7 +233,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetSteamID() internal SteamId GetSteamID()
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetSteamID( Self, ref retVal ); _GetSteamID( Self, ref retVal );
return retVal; return retVal;
@ -400,7 +400,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FCreateUnauthenticatedUserConnection( IntPtr self, ref SteamId retVal ); private delegate void FCreateUnauthenticatedUserConnection( IntPtr self, ref SteamId retVal );
#else #else
private delegate SteamId FCreateUnauthenticatedUserConnection( IntPtr self ); private delegate SteamId FCreateUnauthenticatedUserConnection( IntPtr self );
@ -410,7 +410,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId CreateUnauthenticatedUserConnection() internal SteamId CreateUnauthenticatedUserConnection()
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_CreateUnauthenticatedUserConnection( Self, ref retVal ); _CreateUnauthenticatedUserConnection( Self, ref retVal );
return retVal; return retVal;

View File

@ -222,7 +222,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetDigitalActionData( IntPtr self, ref DigitalState retVal, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); private delegate void FGetDigitalActionData( IntPtr self, ref DigitalState retVal, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle );
#else #else
private delegate DigitalState FGetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); private delegate DigitalState FGetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle );
@ -232,7 +232,7 @@ namespace Steamworks
#endregion #endregion
internal DigitalState GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) internal DigitalState GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( DigitalState ); var retVal = default( DigitalState );
_GetDigitalActionData( Self, ref retVal, inputHandle, digitalActionHandle ); _GetDigitalActionData( Self, ref retVal, inputHandle, digitalActionHandle );
return retVal; return retVal;
@ -265,7 +265,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetAnalogActionData( IntPtr self, ref AnalogState retVal, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); private delegate void FGetAnalogActionData( IntPtr self, ref AnalogState retVal, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle );
#else #else
private delegate AnalogState FGetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); private delegate AnalogState FGetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle );
@ -275,7 +275,7 @@ namespace Steamworks
#endregion #endregion
internal AnalogState GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) internal AnalogState GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( AnalogState ); var retVal = default( AnalogState );
_GetAnalogActionData( Self, ref retVal, inputHandle, analogActionHandle ); _GetAnalogActionData( Self, ref retVal, inputHandle, analogActionHandle );
return retVal; return retVal;
@ -332,7 +332,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetMotionData( IntPtr self, ref MotionState retVal, InputHandle_t inputHandle ); private delegate void FGetMotionData( IntPtr self, ref MotionState retVal, InputHandle_t inputHandle );
#else #else
private delegate MotionState FGetMotionData( IntPtr self, InputHandle_t inputHandle ); private delegate MotionState FGetMotionData( IntPtr self, InputHandle_t inputHandle );
@ -342,7 +342,7 @@ namespace Steamworks
#endregion #endregion
internal MotionState GetMotionData( InputHandle_t inputHandle ) internal MotionState GetMotionData( InputHandle_t inputHandle )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( MotionState ); var retVal = default( MotionState );
_GetMotionData( Self, ref retVal, inputHandle ); _GetMotionData( Self, ref retVal, inputHandle );
return retVal; return retVal;

View File

@ -232,7 +232,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetLobbyByIndex( IntPtr self, ref SteamId retVal, int iLobby ); private delegate void FGetLobbyByIndex( IntPtr self, ref SteamId retVal, int iLobby );
#else #else
private delegate SteamId FGetLobbyByIndex( IntPtr self, int iLobby ); private delegate SteamId FGetLobbyByIndex( IntPtr self, int iLobby );
@ -242,7 +242,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetLobbyByIndex( int iLobby ) internal SteamId GetLobbyByIndex( int iLobby )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetLobbyByIndex( Self, ref retVal, iLobby ); _GetLobbyByIndex( Self, ref retVal, iLobby );
return retVal; return retVal;
@ -309,7 +309,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetLobbyMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDLobby, int iMember ); private delegate void FGetLobbyMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDLobby, int iMember );
#else #else
private delegate SteamId FGetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember ); private delegate SteamId FGetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember );
@ -319,7 +319,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetLobbyMemberByIndex( SteamId steamIDLobby, int iMember ) internal SteamId GetLobbyMemberByIndex( SteamId steamIDLobby, int iMember )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetLobbyMemberByIndex( Self, ref retVal, steamIDLobby, iMember ); _GetLobbyMemberByIndex( Self, ref retVal, steamIDLobby, iMember );
return retVal; return retVal;
@ -517,7 +517,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetLobbyOwner( IntPtr self, ref SteamId retVal, SteamId steamIDLobby ); private delegate void FGetLobbyOwner( IntPtr self, ref SteamId retVal, SteamId steamIDLobby );
#else #else
private delegate SteamId FGetLobbyOwner( IntPtr self, SteamId steamIDLobby ); private delegate SteamId FGetLobbyOwner( IntPtr self, SteamId steamIDLobby );
@ -527,7 +527,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetLobbyOwner( SteamId steamIDLobby ) internal SteamId GetLobbyOwner( SteamId steamIDLobby )
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetLobbyOwner( Self, ref retVal, steamIDLobby ); _GetLobbyOwner( Self, ref retVal, steamIDLobby );
return retVal; return retVal;

View File

@ -105,7 +105,7 @@ namespace Steamworks
#region FunctionMeta #region FunctionMeta
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] [UnmanagedFunctionPointer( CallingConvention.ThisCall )]
#if PLATFORM_WIN64 #if PLATFORM_WIN
private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); private delegate void FGetSteamID( IntPtr self, ref SteamId retVal );
#else #else
private delegate SteamId FGetSteamID( IntPtr self ); private delegate SteamId FGetSteamID( IntPtr self );
@ -115,7 +115,7 @@ namespace Steamworks
#endregion #endregion
internal SteamId GetSteamID() internal SteamId GetSteamID()
{ {
#if PLATFORM_WIN64 #if PLATFORM_WIN
var retVal = default( SteamId ); var retVal = default( SteamId );
_GetSteamID( Self, ref retVal ); _GetSteamID( Self, ref retVal );
return retVal; return retVal;

View File

@ -209,7 +209,7 @@ namespace Generator
if ( returnType.IsReturnedWeird ) if ( returnType.IsReturnedWeird )
{ {
WriteLine( "#if PLATFORM_WIN64" ); WriteLine( "#if PLATFORM_WIN" );
WriteLine( $"private delegate void F{func.Name}( IntPtr self, ref {returnType.TypeName} retVal, {delegateargstr} );".Replace( " retVal, )", " retVal )" ) ); WriteLine( $"private delegate void F{func.Name}( IntPtr self, ref {returnType.TypeName} retVal, {delegateargstr} );".Replace( " retVal, )", " retVal )" ) );
WriteLine( "#else" ); WriteLine( "#else" );
} }
@ -232,7 +232,7 @@ namespace Generator
if ( returnType.IsReturnedWeird ) if ( returnType.IsReturnedWeird )
{ {
WriteLine( "#if PLATFORM_WIN64" ); WriteLine( "#if PLATFORM_WIN" );
{ {
WriteLine( $"var retVal = default( {returnType.TypeName} );" ); WriteLine( $"var retVal = default( {returnType.TypeName} );" );
WriteLine( $"_{func.Name}( Self, ref retVal, {callargs} );".Replace( ", );", " );" ) ); WriteLine( $"_{func.Name}( Self, ref retVal, {callargs} );".Replace( ", );", " );" ) );