diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 15:27:12 (GMT) |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2024-10-31 15:27:12 (GMT) |
commit | 5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch) | |
tree | 2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/m4/iswpunct.m4 | |
parent | 6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff) | |
download | monitoring-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.m4 | 49 |
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 | ||
3 | dnl Copyright (C) 2023-2024 Free Software Foundation, Inc. | ||
4 | dnl This file is free software; the Free Software Foundation | ||
5 | dnl gives unlimited permission to copy and/or distribute it, | ||
6 | dnl with or without modifications, as long as this notice is preserved. | ||
7 | |||
8 | AC_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> | ||
25 | int | ||
26 | main (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 | ]) | ||