From a2290efbb395b35330377e0a9acef9b92dab9aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Sat, 1 Mar 2008 12:29:10 +0000 Subject: do better "detection" of callback size without having to define it in Makefile (inspired by apt) --- Makefile.PL | 3 --- URPM.xs | 12 +++++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index dc16611..6ab4b17 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -50,9 +50,6 @@ if ($pversion ge v4.4.90 && $pversion lt v4.5) { push @rpmflags, '-DRPM_ORG'; } else { # rpm5.org version - if ($pversion ge v4.4.5 && $pversion lt v5.0) { - push @rpmflags, '-DRPM_CALLBACK_LONGLONG'; - } if ($pversion ge v4.4.6) { push @rpmflags, '-DRPM_446'; } diff --git a/URPM.xs b/URPM.xs index d9b5823..8f69ce2 100644 --- a/URPM.xs +++ b/URPM.xs @@ -1322,18 +1322,16 @@ ts_nosignature(rpmts ts) { rpmtsSetVSFlags(ts, _RPMVSF_NODIGESTS | _RPMVSF_NOSIGNATURES); } - -#ifdef RPM_CALLBACK_LONGLONG -/* That's for rpm >= 4.4.5 */ -# define RPM_CALLBACK_AMOUNT_TYPE unsigned long long +#if HAVE_RPM_RPMCB_H +typedef unsigned long long rpmCallbackSize_t; #else -# define RPM_CALLBACK_AMOUNT_TYPE unsigned long +typedef unsigned long rpmCallbackSize_t; #endif static void *rpmRunTransactions_callback(const void *h, const rpmCallbackType what, - const RPM_CALLBACK_AMOUNT_TYPE amount, - const RPM_CALLBACK_AMOUNT_TYPE total, + const rpmCallbackSize_t amount, + const rpmCallbackSize_t total, fnpyKey pkgKey, rpmCallbackData data) { static struct timeval tprev; -- cgit v1.2.1