lsteamclient: Fix SteamAPI_CheckCallbackRegistered_t calling convention

This commit is contained in:
Andrew Eikum 2019-08-15 14:50:30 -05:00
parent abfb04f8cc
commit 80465e2a7d
7 changed files with 25 additions and 7 deletions

View File

@ -174,6 +174,7 @@ void cppISteamClient_SteamClient016_Remove_SteamAPI_CPostAPIResultInProcess(void
void cppISteamClient_SteamClient016_Set_SteamAPI_CCheckCallbackRegisteredInProcess(void *linux_side, SteamAPI_CheckCallbackRegistered_t func)
{
func = (SteamAPI_CheckCallbackRegistered_t)manual_convert_SteamAPI_CheckCallbackRegistered_t((void*)func);
((ISteamClient*)linux_side)->Set_SteamAPI_CCheckCallbackRegisteredInProcess((SteamAPI_CheckCallbackRegistered_t)func);
}

View File

@ -174,6 +174,7 @@ void cppISteamClient_SteamClient017_DEPRECATED_Remove_SteamAPI_CPostAPIResultInP
void cppISteamClient_SteamClient017_Set_SteamAPI_CCheckCallbackRegisteredInProcess(void *linux_side, SteamAPI_CheckCallbackRegistered_t func)
{
func = (SteamAPI_CheckCallbackRegistered_t)manual_convert_SteamAPI_CheckCallbackRegistered_t((void*)func);
((ISteamClient*)linux_side)->Set_SteamAPI_CCheckCallbackRegisteredInProcess((SteamAPI_CheckCallbackRegistered_t)func);
}

View File

@ -180,6 +180,7 @@ void cppISteamClient_SteamClient018_DEPRECATED_Remove_SteamAPI_CPostAPIResultInP
void cppISteamClient_SteamClient018_Set_SteamAPI_CCheckCallbackRegisteredInProcess(void *linux_side, SteamAPI_CheckCallbackRegistered_t func)
{
func = (SteamAPI_CheckCallbackRegistered_t)manual_convert_SteamAPI_CheckCallbackRegistered_t((void*)func);
((ISteamClient*)linux_side)->Set_SteamAPI_CCheckCallbackRegisteredInProcess((SteamAPI_CheckCallbackRegistered_t)func);
}

View File

@ -5,7 +5,7 @@
from __future__ import print_function
CLANG_PATH='/usr/lib/clang/8.0.0'
CLANG_PATH='/usr/lib/clang/8.0.1'
import pprint
import sys
@ -178,7 +178,8 @@ manually_handled_methods = {
# manual converters for simple types (function pointers)
manual_type_converters = [
"FSteamNetworkingSocketsDebugOutput"
"FSteamNetworkingSocketsDebugOutput",
"SteamAPI_CheckCallbackRegistered_t"
]
# manual converters for specific parameters

View File

@ -205,11 +205,9 @@ typedef struct SteamNetworkingQuickConnectionStatus SteamNetworkingQuickConnecti
typedef struct SteamDatagramRelayAuthTicket SteamDatagramRelayAuthTicket;
typedef struct SteamDatagramHostedAddress SteamDatagramHostedAddress;
/* FIXME: we don't care about fn pointer types, just pass 'em through */
typedef void *SteamAPI_CheckCallbackRegistered_t;
typedef void *SteamAPIWarningMessageHook_t;
typedef void *SteamAPI_PostAPIResultInProcess_t;
typedef uint32 (*SteamAPI_CheckCallbackRegistered_t)(int cb);
typedef void *SteamAPIWarningMessageHook_t; //already cdecl, no need for conversion(?)
typedef void *SteamAPI_PostAPIResultInProcess_t; //unused
typedef void (*FSteamNetworkingSocketsDebugOutput)(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg);
typedef uint8 Salt_t[8];

View File

@ -48,6 +48,7 @@ void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version);
void *create_LinuxISteamMatchmakingPlayersResponse(void *win, const char *version);
void *create_LinuxISteamMatchmakingRulesResponse(void *win, const char *version);
void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func);
void *manual_convert_SteamAPI_CheckCallbackRegistered_t(void *win_func);
extern char g_tmppath[PATH_MAX];

View File

@ -295,3 +295,18 @@ void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func)
stored_FSteamNetworkingSocketsDebugOutput = (void*)win_func;
return &lin_FSteamNetworkingSocketsDebugOutput;
}
/***** SteamAPI_CheckCallbackRegistered_t *****/
static uint32 (__attribute__((ms_abi)) *stored_SteamAPI_CheckCallbackRegistered_t)(int cb);
static uint32 lin_SteamAPI_CheckCallbackRegistered_t(int cb)
{
return stored_SteamAPI_CheckCallbackRegistered_t(cb);
}
void *manual_convert_SteamAPI_CheckCallbackRegistered_t(void *win_func)
{
stored_SteamAPI_CheckCallbackRegistered_t = (void*)win_func;
return &lin_SteamAPI_CheckCallbackRegistered_t;
}