summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-01-03 18:04:37 +0100
committerGravatar Nikias Bassen2017-01-03 18:04:37 +0100
commit5b338a411203cd42e7b09d56585e1acb408f406e (patch)
treeddfcaf1ad14baef4312eabbcd199720bd4c89c68 /src
parentb848efcd471e8a20f3720d6e1f690c15a369e7df (diff)
downloadlibusbmuxd-5b338a411203cd42e7b09d56585e1acb408f406e.tar.gz
libusbmuxd-5b338a411203cd42e7b09d56585e1acb408f406e.tar.bz2
win32: Only define sleep() when it's not found and reorder header file includes
Diffstat (limited to 'src')
-rw-r--r--src/libusbmuxd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c
index 8003730..f7508c5 100644
--- a/src/libusbmuxd.c
+++ b/src/libusbmuxd.c
@@ -47,10 +47,15 @@
#define EBADMSG 104
#endif
+#include <unistd.h>
+#include <signal.h>
+
#ifdef WIN32
#include <winsock2.h>
#include <windows.h>
+#ifndef HAVE_SLEEP
#define sleep(x) Sleep(x*1000)
+#endif
#else
#include <sys/socket.h>
#include <arpa/inet.h>
@@ -65,9 +70,6 @@
#define USBMUXD_SOCKET_NAME "usbmuxd"
#endif /* HAVE_INOTIFY */
-#include <unistd.h>
-#include <signal.h>
-
#include <plist/plist.h>
#define PLIST_BUNDLE_ID "org.libimobiledevice.usbmuxd"
#define PLIST_CLIENT_VERSION_STRING "usbmuxd built for freedom"