summaryrefslogtreecommitdiffstats
path: root/gl/m4/iswpunct.m4
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 15:27:12 (GMT)
commit5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch)
tree2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/m4/iswpunct.m4
parent6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff)
downloadmonitoring-plugins-5be04ec2ceb1df77afbca4fcbf9e92a712612d6f.tar.gz
Sync with the latest Gnulib code (d4ec02b3cc)refs/pull/2037/head
Diffstat (limited to 'gl/m4/iswpunct.m4')
-rw-r--r--gl/m4/iswpunct.m449
1 files changed, 49 insertions, 0 deletions
diff --git a/gl/m4/iswpunct.m4 b/gl/m4/iswpunct.m4
new file mode 100644
index 0000000..1edf58a
--- /dev/null
+++ b/gl/m4/iswpunct.m4
@@ -0,0 +1,49 @@
1# iswpunct.m4
2# serial 2
3dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWPUNCT],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13
14 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
15 dnl <wctype.h> redefines iswpunct already.
16 REPLACE_ISWPUNCT="$REPLACE_ISWCNTRL"
17 else
18 AC_CACHE_CHECK([whether iswpunct is consistent with ispunct],
19 [gl_cv_func_iswpunct_works],
20 [AC_RUN_IFELSE(
21 [AC_LANG_SOURCE([[
22#include <ctype.h>
23#include <wchar.h>
24#include <wctype.h>
25int
26main (int argc, char *argv[])
27{
28 int result = 0;
29 /* This fails on Android 11. */
30 if ((! iswpunct ('\`')) != (! ispunct ('\`')))
31 result |= 1;
32 return result;
33}]])],
34 [gl_cv_func_iswpunct_works=yes],
35 [gl_cv_func_iswpunct_works=no],
36 [case "$host_os" in
37 # Guess no on Android.
38 android*) gl_cv_func_iswpunct_works="guessing no" ;;
39 # Guess yes otherwise.
40 *) gl_cv_func_iswpunct_works="guessing yes" ;;
41 esac
42 ])
43 ])
44 case "$gl_cv_func_iswpunct_works" in
45 *yes) ;;
46 *) REPLACE_ISWPUNCT=1 ;;
47 esac
48 fi
49])