From 7a873a8f1284058c968c5d8026fbde7867913cb5 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 19 Apr 2008 12:36:18 -0500 Subject: Give libalpm native support for both libdownload and libfetch This should remove the need for any additional patching to run on platforms that have libfetch available but not libdownload. It isn't the prettiest, but we have kept our libdownload impact down to just a few files, so it can be easily done. Signed-off-by: Dan McGee --- lib/libalpm/dload.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/dload.c') diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 0977eea0..44acec70 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -24,8 +24,25 @@ #include #include #include -#if defined(INTERNAL_DOWNLOAD) -#include /* libdownload */ +#include +/* the following two are needed on BSD for libfetch */ +#if defined(HAVE_SYS_SYSLIMITS_H) +#include /* PATH_MAX */ +#endif +#if defined(HAVE_SYS_PARAM_H) +#include /* MAXHOSTNAMELEN */ +#endif + +#if defined(HAVE_LIBDOWNLOAD) +#include +#elif defined(HAVE_LIBFETCH) +#include +#define downloadFreeURL fetchFreeURL +#define downloadLastErrCode fetchLastErrCode +#define downloadLastErrString fetchLastErrString +#define downloadParseURL fetchParseURL +#define downloadTimeout fetchTimeout +#define downloadXGet fetchXGet #endif /* libalpm */ -- cgit v1.2.3-2-g168b