]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
windows: Overload sleep() cancellable when it is defined in <unistd.h>
authorMartin Willi <martin@revosec.ch>
Thu, 2 Jan 2014 13:29:35 +0000 (14:29 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:04 +0000 (15:53 +0200)
src/libstrongswan/utils/windows.h

index 3e317ce5920c7000d1258f3a78f6540923c18e95..2de6f043b460273a5c5c169c33d58abeb4012daf 100644 (file)
@@ -25,6 +25,7 @@
 #include <ws2tcpip.h>
 #include <direct.h>
 #include <inttypes.h>
+#include <unistd.h>
 
 /* undef Windows variants evaluating values more than once */
 #undef min
@@ -79,7 +80,8 @@ static inline int sched_yield(void)
 /**
  * Replacement of sleep(3), cancellable by thread_cancel()
  */
-static inline int sleep(unsigned int seconds)
+#define sleep sleep_cancellable
+static inline int sleep_cancellable(unsigned int seconds)
 {
        SleepEx(seconds * 1000, TRUE);
        return 0;