mirror of
https://github.com/curl/curl.git
synced 2026-08-26 16:53:32 +03:00
Fix compiler warning/error: ISO C90 forbids mixed declarations and code
This commit is contained in:
parent
0e2d3b7b6c
commit
da2b75a026
1 changed files with 5 additions and 1 deletions
|
|
@ -76,6 +76,11 @@
|
||||||
*/
|
*/
|
||||||
static void wait_ms(int timeout_ms)
|
static void wait_ms(int timeout_ms)
|
||||||
{
|
{
|
||||||
|
#if !defined(__MSDOS__) && \
|
||||||
|
!defined(USE_WINSOCK) && \
|
||||||
|
!defined(HAVE_POLL_FINE)
|
||||||
|
struct timeval timeout;
|
||||||
|
#endif
|
||||||
if (timeout_ms <= 0)
|
if (timeout_ms <= 0)
|
||||||
return;
|
return;
|
||||||
#if defined(__MSDOS__)
|
#if defined(__MSDOS__)
|
||||||
|
|
@ -85,7 +90,6 @@ static void wait_ms(int timeout_ms)
|
||||||
#elif defined(HAVE_POLL_FINE)
|
#elif defined(HAVE_POLL_FINE)
|
||||||
poll(NULL, 0, timeout_ms);
|
poll(NULL, 0, timeout_ms);
|
||||||
#else
|
#else
|
||||||
struct timeval timeout;
|
|
||||||
timeout.tv_sec = timeout_ms / 1000;
|
timeout.tv_sec = timeout_ms / 1000;
|
||||||
timeout.tv_usec = (timeout_ms % 1000) * 1000;
|
timeout.tv_usec = (timeout_ms % 1000) * 1000;
|
||||||
select(0, NULL, NULL, NULL, &timeout);
|
select(0, NULL, NULL, NULL, &timeout);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue