C89 buildfix (#13923)

* C89 buildfix

* More buildfixes
This commit is contained in:
Cthulhu-throwaway 2022-05-10 02:37:33 -03:00 committed by GitHub
parent af224493b3
commit 796bc15837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 36 deletions

View File

@ -3980,9 +3980,11 @@ void netplay_hangup(netplay_t *netplay,
{
dmsg = msg_hash_to_str(MSG_NETPLAY_CLIENT_HANGUP);
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
netplay->is_connected = false;
}
@ -7875,9 +7877,11 @@ static void netplay_announce_cb(retro_task_t *task,
}
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_HOSTING;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_HOSTING;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
}
@ -8167,9 +8171,11 @@ static void netplay_disconnect(netplay_t *netplay)
deinit_netplay();
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
}
@ -8456,9 +8462,11 @@ bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data)
case RARCH_NETPLAY_CTL_DISABLE:
net_st->netplay_enabled = false;
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
goto done;

View File

@ -1952,11 +1952,13 @@ bool command_event(enum event_command cmd, void *data)
return false;
}
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
#ifdef HAVE_DYNAMIC
path_clear(RARCH_PATH_CORE);
@ -5500,10 +5502,11 @@ bool retroarch_main_init(int argc, char *argv[])
#endif
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
#if defined(HAVE_AUDIOMIXER)
@ -6013,22 +6016,26 @@ bool retroarch_main_quit(void)
settings_t *settings = config_get_ptr();
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_SHUTDOWN;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_SHUTDOWN;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
#ifdef HAVE_DISCORD
discord_state_t *discord_st = discord_state_get_ptr();
if (discord_st->ready)
{
Discord_ClearPresence();
discord_state_t *discord_st = discord_state_get_ptr();
if (discord_st->ready)
{
Discord_ClearPresence();
#ifdef DISCORD_DISABLE_IO_THREAD
Discord_UpdateConnection();
Discord_UpdateConnection();
#endif
Discord_Shutdown();
discord_st->ready = false;
Discord_Shutdown();
discord_st->ready = false;
}
discord_st->inited = false;
}
discord_st->inited = false;
#endif
/* Restore original refresh rate, if it has been changed

View File

@ -2593,11 +2593,13 @@ static bool task_load_content_internal(
goto end;
#ifdef HAVE_PRESENCE
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
{
presence_userdata_t userdata;
userdata.status = PRESENCE_NETPLAY_NETPLAY_STOPPED;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
userdata.status = PRESENCE_MENU;
command_event(CMD_EVENT_PRESENCE_UPDATE, &userdata);
}
#endif
/* Loads content into currently selected core. */