Build fix - make RetroArch work without HAVE_NETPLAY defined

This commit is contained in:
twinaphex 2014-08-02 04:21:07 +02:00
parent 2c2f60cab4
commit 25e0ead417
3 changed files with 8 additions and 7 deletions

View File

@ -61,7 +61,7 @@ static bool socket_nonblock(int fd)
#endif #endif
} }
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port) static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
{ {
if (!netplay_init_network()) if (!netplay_init_network())
@ -129,7 +129,7 @@ rarch_cmd_t *rarch_cmd_new(bool stdin_enable, bool network_enable, uint16_t port
if (!handle) if (!handle)
return NULL; return NULL;
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
handle->net_fd = -1; handle->net_fd = -1;
if (network_enable && !cmd_init_network(handle, port)) if (network_enable && !cmd_init_network(handle, port))
goto error; goto error;
@ -499,7 +499,7 @@ void rarch_cmd_poll(rarch_cmd_t *handle)
#endif #endif
} }
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool send_udp_packet(const char *host, uint16_t port, const char *msg) static bool send_udp_packet(const char *host, uint16_t port, const char *msg)
{ {
struct addrinfo hints, *res = NULL; struct addrinfo hints, *res = NULL;

View File

@ -84,6 +84,8 @@ void netplay_ipaddress_callback(void *userdata, const char *str)
menu_key_end_line(menu); menu_key_end_line(menu);
} }
#endif
void netplay_nickname_callback(void *userdata, const char *str) void netplay_nickname_callback(void *userdata, const char *str)
{ {
menu_handle_t *menu = (menu_handle_t*)userdata; menu_handle_t *menu = (menu_handle_t*)userdata;
@ -97,7 +99,6 @@ void netplay_nickname_callback(void *userdata, const char *str)
} }
menu_key_end_line(menu); menu_key_end_line(menu);
} }
#endif
void audio_device_callback(void *userdata, const char *str) void audio_device_callback(void *userdata, const char *str)
{ {

View File

@ -795,7 +795,7 @@ static void print_help(void)
puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host."); puts("\t\tHowever, the client will not be able to play. Multiple clients can connect to the host.");
#endif #endif
puts("\t--nick: Picks a username (for use with netplay). Not mandatory."); puts("\t--nick: Picks a username (for use with netplay). Not mandatory.");
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
puts("\t--command: Sends a command over UDP to an already running RetroArch process."); puts("\t--command: Sends a command over UDP to an already running RetroArch process.");
puts("\t\tAvailable commands are listed if command is invalid."); puts("\t\tAvailable commands are listed if command is invalid.");
#endif #endif
@ -952,7 +952,7 @@ static void parse_input(int argc, char *argv[])
{ "spectate", 0, &val, 'S' }, { "spectate", 0, &val, 'S' },
#endif #endif
{ "nick", 1, &val, 'N' }, { "nick", 1, &val, 'N' },
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
{ "command", 1, &val, 'c' }, { "command", 1, &val, 'c' },
#endif #endif
{ "ups", 1, NULL, 'U' }, { "ups", 1, NULL, 'U' },
@ -1182,7 +1182,7 @@ static void parse_input(int argc, char *argv[])
strlcpy(g_settings.username, optarg, sizeof(g_settings.username)); strlcpy(g_settings.username, optarg, sizeof(g_settings.username));
break; break;
#ifdef HAVE_NETWORK_CMD #if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
case 'c': case 'c':
if (network_cmd_send(optarg)) if (network_cmd_send(optarg))
exit(0); exit(0);