From 30b444ab92a0e00ee675e6f3483861eb7aaefada Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 20 Apr 2008 13:30:44 +0000 Subject: [PATCH] (gtk) #891: patch: add option to disable libnotify support at compile time --- configure.ac | 20 ++++++++++---------- libtransmission/inout.c | 6 ++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index b7d8f79b1..c129857d1 100644 --- a/configure.ac +++ b/configure.ac @@ -108,15 +108,15 @@ if test "x$use_gio" = "xyes"; then AC_DEFINE([HAVE_GIO], 1) fi -PKG_CHECK_MODULES([LIBNOTIFY], - [libnotify >= $LIBNOTIFY_MINIMUM], - [use_libnotify=yes], - [use_libnotify=no]) -AC_SUBST(LIBNOTIFY_LIBS) -AC_SUBST(LIBNOTIFY_CFLAGS) -if test "x$use_libnotify" = "xyes"; then - AC_DEFINE([HAVE_LIBNOTIFY], 1) -fi +AC_ARG_ENABLE([libnotify], + AS_HELP_STRING([--enable-libnotify],[enable notifications]),, + [enable_libnotify=yes]) +if test x$enable_libnotify = xyes ; then + PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= $LIBNOTIFY_MINIMUM]) + AC_SUBST(LIBNOTIFY_LIBS) + AC_SUBST(LIBNOTIFY_CFLAGS) + AC_DEFINE([HAVE_LIBNOTIFY], 1) +fi PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1 >= $DBUS_GLIB_MINIMUM], @@ -303,7 +303,7 @@ Configuration: Build GTK+ client: ${build_gtk} ... gio support: ${use_gio} ... dbus-glib support: ${use_dbus_glib} - ... libnotify support: ${use_libnotify} + ... libnotify support: ${enable_libnotify} Build OS X client: ${build_darwin} Build wxWidgets client: ${build_wx} diff --git a/libtransmission/inout.c b/libtransmission/inout.c index 50a75c7f4..e5945366c 100644 --- a/libtransmission/inout.c +++ b/libtransmission/inout.c @@ -125,7 +125,13 @@ findFileLocation( const tr_torrent * tor, assert( inf->files[first].offset <= offset ); if( offset >= inf->files[first].offset + inf->files[first].length ) { + fprintf( stderr, "piece index is %lu\n", (unsigned long)pieceIndex ); + fprintf( stderr, "piece offset is %lu\n", (unsigned long)pieceOffset ); + fprintf( stderr, "piece size is %lu\n", (unsigned long)inf->pieceSize ); + fprintf( stderr, "inf->totalSize is %"PRIu64"\n", inf->totalSize ); fprintf( stderr, "offset is %"PRIu64"\n", offset ); + fprintf( stderr, "first is is %"PRIu64"\n", (uint64_t)first ); + fprintf( stderr, "inf->fileCount is %"PRIu64"\n", (uint64_t)inf->fileCount ); fprintf( stderr, "inf->fileCount is %d\n", (int)inf->fileCount ); fprintf( stderr, "inf->files[first].offset is %"PRIu64"\n", inf->files[first].offset ); fprintf( stderr, "inf->files[first].length is %"PRIu64"\n", inf->files[first].length ); -- 2.40.0