mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
Replace some references to sys_timer_usleep
This commit is contained in:
parent
3824812ac9
commit
5caf0627f8
@ -46,6 +46,7 @@
|
||||
#define NETWORK_COMPAT_HEADERS 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef NETWORK_COMPAT_HEADERS
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
@ -71,6 +72,7 @@
|
||||
|
||||
#include <compat/strl.h>
|
||||
#include <retro_inline.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
/*
|
||||
****************************************************************************
|
||||
@ -748,22 +750,7 @@ static int64_t rsnd_get_time_usec(void)
|
||||
|
||||
static void rsnd_sleep(int msec)
|
||||
{
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
sys_timer_usleep(1000 * msec);
|
||||
#elif defined(PSP)
|
||||
sceKernelDelayThread(1000 * msec);
|
||||
#elif defined(_WIN32)
|
||||
Sleep(msec);
|
||||
#elif defined(XENON)
|
||||
udelay(1000 * msec);
|
||||
#elif defined(GEKKO) || defined(__PSL1GHT__) || defined(__QNX__)
|
||||
usleep(1000 * msec);
|
||||
#else
|
||||
struct timespec tv = {0};
|
||||
tv.tv_sec = msec / 1000;
|
||||
tv.tv_nsec = (msec % 1000) * 1000000;
|
||||
nanosleep(&tv, NULL);
|
||||
#endif
|
||||
rarch_sleep(msec);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
|
||||
#ifndef GEKKO
|
||||
#include <net/net_compat.h>
|
||||
#endif
|
||||
@ -92,7 +94,7 @@ static int if_up_with(int index)
|
||||
if (state == CELL_NET_CTL_STATE_IPObtained)
|
||||
break;
|
||||
|
||||
sys_timer_usleep(500 * 1000);
|
||||
rarch_sleep(500);
|
||||
timeout_count--;
|
||||
if (index && timeout_count < 0)
|
||||
{
|
||||
@ -103,17 +105,15 @@ static int if_up_with(int index)
|
||||
#elif defined(GEKKO)
|
||||
char t[16];
|
||||
if (if_config(t, NULL, NULL, TRUE) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
sock=socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
target.sin_family = AF_INET;
|
||||
target.sin_port = htons(PC_DEVELOPMENT_UDP_PORT);
|
||||
target.sin_port = htons(PC_DEVELOPMENT_UDP_PORT);
|
||||
#ifdef GEKKO
|
||||
target.sin_len = 8;
|
||||
target.sin_len = 8;
|
||||
#endif
|
||||
|
||||
inet_pton(AF_INET, PC_DEVELOPMENT_IP_ADDRESS, &target.sin_addr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user