Hash :
9ef347ea
Author :
Date :
2024-04-05T12:04:59
Update for NetBSD 9.3 and 10.0. * doc/*/*.texi: Update for NetBSD 9.3 and 10.0. * m4/expm1l.m4 (gl_FUNC_EXPM1L): Update comments and cross-compilation guess. * m4/log1pl.m4 (gl_FUNC_LOG1PL_WORKS): Likewise. * m4/log2l.m4 (gl_FUNC_LOG2L_WORKS): Likewise. * m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LA): Likewise. * m4/remainderl.m4 (gl_FUNC_REMAINDERL_WORKS): Likewise. * m4/fcntl.m4: Update comments. * m4/fenv-environment.m4: Likewise. * m4/fenv-exceptions-trapping.m4: Likewise. * m4/fnmatch.m4: Likewise. * m4/getcwd-abort-bug.m4: Likewise. * m4/iswdigit.m4: Likewise. * m4/iswxdigit.m4: Likewise. * m4/modfl.m4: Likewise. * m4/wcscmp.m4: Likewise. * m4/wcsncmp.m4: Likewise. * m4/wctrans.m4: Likewise. * m4/wcwidth.m4: Likewise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
# wcscmp.m4
# serial 6
dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_WCSCMP],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([wcscmp])
if test $ac_cv_func_wcscmp = no; then
HAVE_WCSCMP=0
else
AC_CACHE_CHECK([whether wcscmp works for all wide characters],
[gl_cv_func_wcscmp_works],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <wchar.h>
int main ()
{
int result = 0;
{ /* This test fails on glibc < 2.15, musl libc 1.2.3, macOS 12.5,
FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.2, Solaris 11.4. */
wchar_t a[2] = { (wchar_t) 0x76547654, 0 };
wchar_t b[2] = { (wchar_t) 0x9abc9abc, 0 };
int cmp = wcscmp (a, b);
if (!((wchar_t)-1 < 0 ? cmp > 0 : cmp < 0))
result |= 1;
}
{ /* This test fails on AIX in 64-bit mode. */
wchar_t c[2] = { (wchar_t) 'x', 0 };
wchar_t d[3] = { (wchar_t) 'x', (wchar_t) 0x9abc9abc, 0 };
int cmp = wcscmp (c, d);
if (!((wchar_t)-1 < 0 ? cmp > 0 : cmp < 0))
result |= 2;
/* This test fails on glibc 2.37 on arm and arm64 CPUs. */
cmp = wcscmp (d, c);
if (!((wchar_t)-1 < 0 ? cmp < 0 : cmp > 0))
result |= 4;
}
return result;
}
]])
],
[gl_cv_func_wcscmp_works=yes],
[gl_cv_func_wcscmp_works=no],
[case "$host_on" in
# Guess no on glibc versions < 2.15.
*-gnu* | gnu*)
AC_EGREP_CPP([Unlucky],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 15)
Unlucky GNU user
#endif
#endif
],
[gl_cv_func_wcscmp_works="guessing no"],
[gl_cv_func_wcscmp_works="guessing yes"])
;;
# Guess no on musl systems.
*-musl* | midipix*) gl_cv_func_wcscmp_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_wcscmp_works="$gl_cross_guess_normal" ;;
esac
])
])
case "$gl_cv_func_wcscmp_works" in
*yes) ;;
*) REPLACE_WCSCMP=1 ;;
esac
fi
])