Hash :
dee279cf
Author :
Date :
2024-01-02T11:37:05
strverscmp: Work around bug in musl libc 1.2.3 and in Cygwin. Reported by Dmitry Bogatov <KAction@gnu.org> via Simon Josefsson in <https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00002.html>. * m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize REPLACE_STRVERSCMP. * m4/strverscmp.m4 (gl_FUNC_STRVERSCMP): Test whether strverscmp works and set REPLACE_STRVERSCMP if not. * lib/string.in.h (strverscmp): Consider REPLACE_STRVERSCMP. * modules/strverscmp (Depends-on, configure.ac): Likewise. * modules/string (Makefile.am): Substitute REPLACE_STRVERSCMP. * tests/test-strverscmp.c (main): Add test cases suggested by Dmitry Bogatov and by Simon Josefsson. * doc/glibc-functions/strverscmp.texi: Mention the musl and Cygwin bug. Update version info regarding FreeBSD.
Description:
Compare strings holding version numbers.
Files:
lib/strverscmp.c
m4/strverscmp.m4
Depends-on:
extensions
libc-config [test $HAVE_STRVERSCMP = 0 || test $REPLACE_STRVERSCMP = 1]
stdint [test $HAVE_STRVERSCMP = 0 || test $REPLACE_STRVERSCMP = 1]
string
configure.ac:
gl_FUNC_STRVERSCMP
gl_CONDITIONAL([GL_COND_OBJ_STRVERSCMP],
[test $HAVE_STRVERSCMP = 0 || test $REPLACE_STRVERSCMP = 1])
AM_COND_IF([GL_COND_OBJ_STRVERSCMP], [
gl_PREREQ_STRVERSCMP
])
gl_STRING_MODULE_INDICATOR([strverscmp])
Makefile.am:
if GL_COND_OBJ_STRVERSCMP
lib_SOURCES += strverscmp.c
endif
Include:
<string.h>
License:
LGPLv2+
Maintainer:
Jim Meyering, glibc