Skip to content

Commit

Permalink
win32: Only define sleep() when it's not found and reorder header fil…
Browse files Browse the repository at this point in the history
…e includes
  • Loading branch information
nikias committed Jan 3, 2017
1 parent b848efc commit 5b338a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
8 changes: 5 additions & 3 deletions src/libusbmuxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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"
Expand Down

0 comments on commit 5b338a4

Please sign in to comment.