diff --git a/lsteamclient/cppISteamClient_SteamClient016.cpp b/lsteamclient/cppISteamClient_SteamClient016.cpp index 7b1c7d5c..e84c3383 100644 --- a/lsteamclient/cppISteamClient_SteamClient016.cpp +++ b/lsteamclient/cppISteamClient_SteamClient016.cpp @@ -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); } diff --git a/lsteamclient/cppISteamClient_SteamClient017.cpp b/lsteamclient/cppISteamClient_SteamClient017.cpp index 0a7e1927..7a6d65d1 100644 --- a/lsteamclient/cppISteamClient_SteamClient017.cpp +++ b/lsteamclient/cppISteamClient_SteamClient017.cpp @@ -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); } diff --git a/lsteamclient/cppISteamClient_SteamClient018.cpp b/lsteamclient/cppISteamClient_SteamClient018.cpp index d59370b4..1050990d 100644 --- a/lsteamclient/cppISteamClient_SteamClient018.cpp +++ b/lsteamclient/cppISteamClient_SteamClient018.cpp @@ -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); } diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index aa145e59..bb12bfe8 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -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 diff --git a/lsteamclient/steam_defs.h b/lsteamclient/steam_defs.h index 058085b2..22586555 100644 --- a/lsteamclient/steam_defs.h +++ b/lsteamclient/steam_defs.h @@ -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]; diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index 64f32945..8b600ee6 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -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]; diff --git a/lsteamclient/steamclient_wrappers.c b/lsteamclient/steamclient_wrappers.c index aa62067e..a7f2b1c6 100644 --- a/lsteamclient/steamclient_wrappers.c +++ b/lsteamclient/steamclient_wrappers.c @@ -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; +}