summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c21f1d7)
raw | patch | inline | side by side (parent: c21f1d7)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 11 Jun 2009 16:15:08 +0000 (18:15 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 11 Jun 2009 16:15:08 +0000 (18:15 +0200) |
neon 0.27 dropped the ne_*64 functions in favor of a new type ne_off_t that
was introduced to take care of LFS stuff. The build process now checks for the
version of neon and uses the appropriate functions accordingly.
was introduced to take care of LFS stuff. The build process now checks for the
version of neon and uses the appropriate functions accordingly.
configure.ac | patch | blob | history | |
src/filecache.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 17210a54bf31b7f6578c470b6248d1a453a71b87..3d4b1f9e240797fb019b1fffd4e2366bbea59817 100644 (file)
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,29 @@ AC_CHECK_FUNCS([ftruncate memset strdup strerror strrchr memchr strchr strcspn])
AC_CHECK_LIB([pthread], [pthread_create])
PKG_CHECK_MODULES(NEON, [ neon >= 0.26 ])
+
+AC_MSG_CHECKING([for NEON >= 0.27])
+if pkg-config --atleast-version=0.27 neon; then
+ AC_DEFINE([NEON_GT_0_27], 1, [Define to 1 if you have neon >= 0.27.])
+ AC_MSG_RESULT([yes])
+
+ OLDCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $NEON_CFLAGS"
+ AC_CHECK_SIZEOF([off_t])
+ AC_CHECK_SIZEOF([ne_off_t], [],
+ [
+AC_INCLUDES_DEFAULT
+#include "ne_defs.h"
+ ])
+ CFLAGS="$OLDCFLAGS"
+
+ if test $ac_cv_sizeof_off_t -gt $ac_cv_sizeof_ne_off_t; then
+ AC_MSG_ERROR([*** Sorry, ne_off_t is incompatible to off_t ***])
+ fi
+else
+ AC_MSG_RESULT([no])
+fi
+
PKG_CHECK_MODULES(FUSE, [ fuse >= 2.5 ])
# LYNX documentation generation
diff --git a/src/filecache.c b/src/filecache.c
index 189db27efad69a7ffe5c33847c842657192619b0..36770566cee9557db011a995288d71c4ab402817 100644 (file)
--- a/src/filecache.c
+++ b/src/filecache.c
}
static int load_up_to_unlocked(struct file_info *fi, off_t l) {
-
+#ifdef NEON_GT_0_27
+#define NE_GET_RANGE ne_get_range
+ ne_content_range range;
+#else
+#define NE_GET_RANGE ne_get_range64
ne_content_range64 range;
+#endif
ne_session *session;
assert(fi);
range.end = l-1;
range.total = 0;
- if (ne_get_range64(session, fi->filename, &range, fi->fd) != NE_OK) {
+ if (NE_GET_RANGE(session, fi->filename, &range, fi->fd) != NE_OK) {
fprintf(stderr, "GET failed: %s\n", ne_get_error(session));
errno = ENOENT;
return -1;
fi->present = l;
return 0;
+#undef NE_GET_RANGE
}
int file_cache_read(void *f, char *buf, size_t size, off_t offset) {