mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 16:45:41 +01:00
Fix mbedtls_net_usleep() on Windows
For some reason select() doesn't seem to work.
This commit is contained in:
parent
d3a9166afe
commit
acecb653d5
@ -425,15 +425,19 @@ int mbedtls_net_set_nonblock( mbedtls_net_context *ctx )
|
|||||||
*/
|
*/
|
||||||
void mbedtls_net_usleep( unsigned long usec )
|
void mbedtls_net_usleep( unsigned long usec )
|
||||||
{
|
{
|
||||||
|
#if defined(_WIN32)
|
||||||
|
Sleep( ( usec + 999 ) / 1000 );
|
||||||
|
#else
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = usec / 1000000;
|
tv.tv_sec = usec / 1000000;
|
||||||
#if !defined(_WIN32) && ( defined(__unix__) || defined(__unix) || \
|
#if defined(__unix__) || defined(__unix) || \
|
||||||
( defined(__APPLE__) && defined(__MACH__) ) )
|
( defined(__APPLE__) && defined(__MACH__) )
|
||||||
tv.tv_usec = (suseconds_t) usec % 1000000;
|
tv.tv_usec = (suseconds_t) usec % 1000000;
|
||||||
#else
|
#else
|
||||||
tv.tv_usec = usec % 1000000;
|
tv.tv_usec = usec % 1000000;
|
||||||
#endif
|
#endif
|
||||||
select( 0, NULL, NULL, NULL, &tv );
|
select( 0, NULL, NULL, NULL, &tv );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user