diff --git a/cores/retropad/retropad.c b/cores/retropad/retropad.c index f1648588f5..e2fd0f7c4a 100644 --- a/cores/retropad/retropad.c +++ b/cores/retropad/retropad.c @@ -234,7 +234,8 @@ void retro_run(void) bool retro_load_game(const struct retro_game_info *info) { - (void)info; + socket_target_t in_target; + check_variables(); s = socket_create( @@ -249,15 +250,11 @@ bool retro_load_game(const struct retro_game_info *info) /* setup address structure */ memset((char *) &si_other, 0, sizeof(si_other)); - si_other.sin_family = AF_INET; - si_other.sin_port = inet_htons(port); -#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY) - si_other.sin_addr.S_un.S_addr = inet_addr(server); -#else - si_other.sin_addr.s_addr = inet_addr(server); + in_target.port = port; + in_target.server = server; + in_target.domain = SOCKET_DOMAIN_INET; - inet_aton(server , &si_other.sin_addr); -#endif + socket_set_target(&si_other, &in_target); log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server); diff --git a/libretro-common/include/net/net_socket.h b/libretro-common/include/net/net_socket.h index c7a0524596..d2e73d33e4 100644 --- a/libretro-common/include/net/net_socket.h +++ b/libretro-common/include/net/net_socket.h @@ -84,6 +84,8 @@ int socket_create( enum socket_type socket_type, enum socket_protocol protocol_type); +void socket_set_target(void *data, socket_target_t *in_addr); + RETRO_END_DECLS #endif