Provide usleep() for Windows.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 13 Nov 2010 14:50:39 +0000 (15:50 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 13 Nov 2010 14:50:39 +0000 (15:50 +0100)
lib/dropin.c
lib/dropin.h

index 89039da..52fb5b8 100644 (file)
@@ -163,3 +163,10 @@ int gettimeofday(struct timeval *tv, void *tz) {
        return 0;
 }
 #endif
+
+#ifdef HAVE_MINGW
+int usleep(long usec) {
+       Sleep(usec / 1000);
+       return 0;
+}
+#endif
index e9d1353..d5cf6d2 100644 (file)
@@ -41,4 +41,8 @@ extern int vasprintf(char **, const char *, va_list ap);
 extern int gettimeofday(struct timeval *, void *);
 #endif
 
+#ifdef HAVE_MINGW
+extern int usleep(long);
+#endif
+
 #endif                                                 /* __DROPIN_H__ */