From 5e4c6de73a023e480a909aac1eb23d93ceb4d0fa Mon Sep 17 00:00:00 2001 From: Tim van der Molen Date: Mon, 15 Jun 2020 19:51:36 +0200 Subject: Enable --version-sort on systems without strverscmp() The --version-sort option requires strverscmp(), but this is a glibc extension that does not exist on OpenBSD and other systems. To enable --version-sort on those systems, provide an internal implementation of strverscmp(). The implementation is from the musl C library and is MIT-licensed. The build process remains the same: the verscmp flag should be set to 1 only if strverscmp() is available in libc. If verscmp is 0, then the internal implementation is used. --- src/filelist.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/filelist.c') diff --git a/src/filelist.c b/src/filelist.c index 4939d4d..361ac19 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -402,7 +402,6 @@ void feh_file_dirname(char *dst, feh_file * f, int maxlen) dst[n] = '\0'; } -#ifdef HAVE_VERSCMP static inline int strcmp_or_strverscmp(const char *s1, const char *s2) { if (!opt.version_sort) @@ -410,9 +409,6 @@ static inline int strcmp_or_strverscmp(const char *s1, const char *s2) else return(strverscmp(s1, s2)); } -#else -#define strcmp_or_strverscmp strcmp -#endif int feh_cmp_filename(void *file1, void *file2) { -- cgit v1.2.3