aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-30 19:10:08 +0100
committerMax Kellermann <max@duempel.org>2008-12-30 19:10:08 +0100
commit7330002960d2c89081614ef5d15f2f5181e5886c (patch)
tree59f40ea3be7725ce0fd8caf64c0962cf0c876e0e /src
parent2eaeb65666c00f02fbdf19ad30d4e0ea9fc69d4d (diff)
downloadmpd-7330002960d2c89081614ef5d15f2f5181e5886c.tar.gz
mpd-7330002960d2c89081614ef5d15f2f5181e5886c.tar.xz
mpd-7330002960d2c89081614ef5d15f2f5181e5886c.zip
utils: implement my_usleep() with Sleep() on WIN32
Sleep() has only millisecond granularity, but good enough for now.
Diffstat (limited to '')
-rw-r--r--src/utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 9f00e687a..9ba95e5fa 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -36,6 +36,10 @@
#include <sys/socket.h>
#endif
+#ifdef WIN32
+#include <windows.h>
+#endif
+
void stripReturnChar(char *string)
{
while (string && (string = strchr(string, '\n'))) {
@@ -45,12 +49,16 @@ void stripReturnChar(char *string)
void my_usleep(long usec)
{
+#ifdef WIN32
+ Sleep(usec / 1000);
+#else
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = usec;
select(0, NULL, NULL, NULL, &tv);
+#endif
}
int ipv6Supported(void)