summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-04-01 02:55:54 +0200
committerGravatar Martin Szulecki2010-04-01 14:38:46 +0200
commit76de20d18914577936e6cfce1747c04b4facb78b (patch)
tree66b3af7aced3e8c608159df3fbf0281f03fecba5
parent7b976601048a8b613b0a7aaced5911868b7ba2bd (diff)
downloadideviceinstaller-76de20d18914577936e6cfce1747c04b4facb78b.tar.gz
ideviceinstaller-76de20d18914577936e6cfce1747c04b4facb78b.tar.bz2
Allow compiling with libimobiledevice < 1.0.0 again
-rw-r--r--configure.ac4
-rw-r--r--src/ideviceinstaller.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5a6073f..af7d0ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,10 @@ AC_PROG_LIBTOOL
# Checks for libraries.
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 0.9.7)
+PKG_CHECK_MODULES(libimobiledevice10, libimobiledevice-1.0 >= 1.0.0, libimobiledevice_1_0=yes, libimobiledevice_1_0=no)
+if test x"$libimobiledevice_1_0" = xyes; then
+ AC_DEFINE([HAVE_LIBIMOBILEDEVICE_1_0], 1, [Define if libimobiledevice is using 1.0.0 API])
+fi
PKG_CHECK_MODULES(libplist, libplist >= 0.15)
PKG_CHECK_MODULES(libzip, libzip >= 0.8)
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index ab62809..d13fdb9 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -20,6 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdlib.h>
#define _GNU_SOURCE 1
#define __USE_GNU 1
@@ -62,8 +65,11 @@ int op_completed = 0;
int err_occured = 0;
int notified = 0;
-
+#ifdef HAVE_LIBIMOBILEDEVICE_1_0
static void notifier(const char *notification, void *unused)
+#else
+static void notifier(const char *notification)
+#endif
{
/* printf("notification received: %s\n", notification);*/
notified = 1;
@@ -348,7 +354,11 @@ int main(int argc, char **argv)
goto leave_cleanup;
}
+#ifdef HAVE_LIBIMOBILEDEVICE_1_0
np_set_notify_callback(np, notifier, NULL);
+#else
+ np_set_notify_callback(np, notifier);
+#endif
const char *noties[3] = { NP_APP_INSTALLED, NP_APP_UNINSTALLED, NULL };