aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-03-18 17:29:24 +0000
committerYang Tse <yangsita@gmail.com>2007-03-18 17:29:24 +0000
commitda2b75a02672153eca1fa8b2bca0d47bb6493b3a (patch)
tree3c7a89f9cc20348fccd6e78b83c876a3957f707d
parent0e2d3b7b6c964e0ca4f0a4fb688c80f9704dafd5 (diff)
Fix compiler warning/error: ISO C90 forbids mixed declarations and code
-rw-r--r--lib/select.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/select.c b/lib/select.c
index 90a6986ca..32261f2c0 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -76,6 +76,11 @@
*/
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)
return;
#if defined(__MSDOS__)
@@ -85,7 +90,6 @@ static void wait_ms(int timeout_ms)
#elif defined(HAVE_POLL_FINE)
poll(NULL, 0, timeout_ms);
#else
- struct timeval timeout;
timeout.tv_sec = timeout_ms / 1000;
timeout.tv_usec = (timeout_ms % 1000) * 1000;
select(0, NULL, NULL, NULL, &timeout);