summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-11-11 18:08:22 +0100
committerGravatar Nikias Bassen2019-11-11 18:10:17 +0100
commit9af2b12552693a47601347e1eafc1e94132d727e (patch)
tree8dbde85e4fc217bba6d04894de73318a682e2536
parent24e06d5247c37a7712d85f032ed3ba74d7a039f8 (diff)
downloadusbmuxd-9af2b12552693a47601347e1eafc1e94132d727e.tar.gz
usbmuxd-9af2b12552693a47601347e1eafc1e94132d727e.tar.bz2
Fix compatibility with latest changes in libimobiledevice
-rw-r--r--configure.ac9
-rw-r--r--src/preflight.c9
2 files changed, 15 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index d0c8201..fb59203 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,15 @@ if test "x$have_limd" = "xyes"; then
AC_DEFINE(HAVE_LIBIMOBILEDEVICE, 1, [Define if you have libimobiledevice support])
AC_SUBST(libimobiledevice_CFLAGS)
AC_SUBST(libimobiledevice_LIBS)
+ AC_CACHE_CHECK(for enum idevice_connection_type, ac_cv_enum_idevice_connection_type,
+ AC_TRY_COMPILE([
+ #include <libimobiledevice/libimobiledevice.h>
+ ], [
+ enum idevice_connection_type conn_type = CONNECTION_USBMUXD;
+ ], ac_cv_enum_idevice_connection_type=yes, ac_cv_enum_idevice_connection_type=no))
+ if (test "$ac_cv_enum_idevice_connection_type" = "yes"); then
+ AC_DEFINE(HAVE_ENUM_IDEVICE_CONNECTION_TYPE, 1, [Define if enum idevice_connection_type is available])
+ fi
fi
else
if test "x$with_preflight" == "xyes"; then
diff --git a/src/preflight.c b/src/preflight.c
index 86a51cf..c7cfa50 100644
--- a/src/preflight.c
+++ b/src/preflight.c
@@ -43,14 +43,17 @@
#include "log.h"
#ifdef HAVE_LIBIMOBILEDEVICE
-enum connection_type {
- CONNECTION_USBMUXD = 1
+#ifndef HAVE_ENUM_IDEVICE_CONNECTION_TYPE
+enum idevice_connection_type {
+ CONNECTION_USBMUXD = 1,
+ CONNECTION_NETWORK
};
+#endif
struct idevice_private {
char *udid;
uint32_t mux_id;
- enum connection_type conn_type;
+ enum idevice_connection_type conn_type;
void *conn_data;
int version;
};