Skip to content

Commit c17b440

Browse files
committed
Fix compilation with latest libimobiledevice
With libimobiledevice/libimobiledevice@692f7c9 function idevice_connection_get_fd was exposed to API, but current version is not marked for release just yet
1 parent cb57ac1 commit c17b440

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ AC_TYPE_UINT8_T
5252
AC_FUNC_MALLOC
5353
AC_FUNC_REALLOC
5454
AC_CHECK_FUNCS([memmove memset regcomp select socket stpcpy strcasecmp strncasecmp strchr strdup strndup strrchr strstr strtol])
55+
AC_CHECK_DECL(idevice_connection_get_fd, [AC_DEFINE([HAVE_IDEVICE_CONNECTION_GET_FD], 1, [ ])], [], [#include <libimobiledevice/libimobiledevice.h>])
5556

5657
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile examples/Makefile])
5758

src/webinspector.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Google BSD license https://developers.google.com/google-bsd-license
22
// Copyright 2012 Google Inc. [email protected]
33

4+
#ifdef HAVE_CONFIG_H
5+
#include <config.h>
6+
#endif
7+
48
#define _GNU_SOURCE
59
#include <errno.h>
610
#include <getopt.h>
@@ -43,6 +47,7 @@ struct wi_private {
4347
// CONNECT
4448
//
4549

50+
#ifndef HAVE_IDEVICE_CONNECTION_GET_FD
4651
// based on libimobiledevice/src/idevice.h
4752
enum connection_type {
4853
CONNECTION_USBMUXD = 1
@@ -77,6 +82,7 @@ wi_status idevice_connection_get_fd(idevice_connection_t connection,
7782
*to_fd = fd;
7883
return WI_SUCCESS;
7984
}
85+
#endif
8086

8187
int wi_connect(const char *device_id, char **to_device_id,
8288
char **to_device_name, int recv_timeout) {

0 commit comments

Comments
 (0)