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/feh.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/feh.h') diff --git a/src/feh.h b/src/feh.h index a76d66f..e735871 100644 --- a/src/feh.h +++ b/src/feh.h @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * strverscmp(3) is a GNU extension. In most supporting C libraries it * requires _GNU_SOURCE to be defined. */ -#ifdef HAVE_VERSCMP +#ifdef HAVE_STRVERSCMP #define _GNU_SOURCE #endif @@ -182,6 +182,9 @@ gib_list *feh_list_jump(gib_list * root, gib_list * l, int direction, int num); #ifdef HAVE_INOTIFY void feh_event_handle_inotify(void); #endif +#ifndef HAVE_STRVERSCMP +int strverscmp(const char *l0, const char *r0); +#endif /* Imlib stuff */ extern Display *disp; -- cgit v1.2.3