From 5b338a411203cd42e7b09d56585e1acb408f406e Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 3 Jan 2017 18:04:37 +0100 Subject: win32: Only define sleep() when it's not found and reorder header file includes --- configure.ac | 2 +- src/libusbmuxd.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 0a405e0..f44e26c 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,7 @@ AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC -AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) +AC_CHECK_FUNCS([strcasecmp strdup strerror strndup sleep]) # Check for operating system AC_MSG_CHECKING([whether we need platform-specific build settings]) 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 +#include + #ifdef WIN32 #include #include +#ifndef HAVE_SLEEP #define sleep(x) Sleep(x*1000) +#endif #else #include #include @@ -65,9 +70,6 @@ #define USBMUXD_SOCKET_NAME "usbmuxd" #endif /* HAVE_INOTIFY */ -#include -#include - #include #define PLIST_BUNDLE_ID "org.libimobiledevice.usbmuxd" #define PLIST_CLIENT_VERSION_STRING "usbmuxd built for freedom" -- cgit v1.1-32-gdbae