summaryrefslogtreecommitdiff
path: root/src/feh.h
diff options
context:
space:
mode:
authorTim van der Molen <tim@kariliq.nl>2020-06-15 19:51:36 +0200
committerTim van der Molen <tim@kariliq.nl>2020-06-15 19:51:36 +0200
commit5e4c6de73a023e480a909aac1eb23d93ceb4d0fa (patch)
tree0a3f9e59cad621a17c8ed3db447285ae1d983cca /src/feh.h
parenta624883d92ea54886b739f1000e39ccf1afc5577 (diff)
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.
Diffstat (limited to 'src/feh.h')
-rw-r--r--src/feh.h5
1 files changed, 4 insertions, 1 deletions
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;