Skip to content

Commit

Permalink
fix non-DLL build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Mar 3, 2024
1 parent 0415bbd commit 01d4a35
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ ifeq ($(HAVE_NETWORKING), 1)

# RetroAchievements
ifeq ($(HAVE_CHEEVOS), 1)
DEFINES += -DHAVE_CHEEVOS
DEFINES += -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH
INCLUDE_DIRS += -Ideps/rcheevos/include

ifneq ($(HAVE_THREADS), 1)
Expand Down
32 changes: 16 additions & 16 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -3109,6 +3109,22 @@ bool rcheevos_load_aborted(void)

#endif /* HAVE_RC_CLIENT */

static void rcheevos_client_process_custom_host()
{
const settings_t* settings = config_get_ptr();
const char* host = settings->arrays.cheevos_custom_host;
if (!host[0])
{
#ifdef HAVE_SSL
host = "https://retroachievements.org";
#else
host = "http://retroachievements.org";
#endif
}

rc_client_set_host(rcheevos_locals.client, host);
}

#ifdef RC_CLIENT_SUPPORTS_RAINTEGRATION

static void rc_client_raintegration_hardcore_changed(rc_client_t* client)
Expand Down Expand Up @@ -3206,22 +3222,6 @@ static void rc_client_raintegration_get_game_name(char* buffer, uint32_t buffer_
path_remove_extension(buffer);
}

static void rcheevos_client_process_custom_host()
{
const settings_t* settings = config_get_ptr();
const char* host = settings->arrays.cheevos_custom_host;
if (!host[0])
{
#ifdef HAVE_SSL
host = "https://retroachievements.org";
#else
host = "http://retroachievements.org";
#endif
}

rc_client_set_host(rcheevos_locals.client, host);
}

static void rcheevos_load_raintegration_callback(int result,
const char* error_message, rc_client_t* client, void* userdata)
{
Expand Down
6 changes: 4 additions & 2 deletions cheevos/cheevos_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ void rcheevos_get_user_agent(rcheevos_locals_t *locals,
}
}

if (stop - ptr > 16)
#ifdef HAVE_RC_CLIENT
if (stop - ptr > 16 && locals->client)
{
*ptr++ = ' ';
ptr += rc_client_get_user_agent_clause(rcheevos_locals.client, ptr, stop - ptr);
ptr += rc_client_get_user_agent_clause(locals->client, ptr, stop - ptr);
}
#endif

*ptr = '\0';
}
Expand Down

0 comments on commit 01d4a35

Please sign in to comment.