summaryrefslogtreecommitdiffstats
path: root/gl/m4/iswpunct.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
commitf5b6b735a731901f09d7f3cc153c1d869269ee83 (patch)
tree565a1b0f3c6a4094a5f2198879fb239053549f1e /gl/m4/iswpunct.m4
parentAdding upstream version 2.12.0. (diff)
downloadman-db-upstream/2.12.1.tar.xz
man-db-upstream/2.12.1.zip
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gl/m4/iswpunct.m4')
-rw-r--r--gl/m4/iswpunct.m448
1 files changed, 48 insertions, 0 deletions
diff --git a/gl/m4/iswpunct.m4 b/gl/m4/iswpunct.m4
new file mode 100644
index 0000000..2be15ab
--- /dev/null
+++ b/gl/m4/iswpunct.m4
@@ -0,0 +1,48 @@
+# iswpunct.m4 serial 2
+dnl Copyright (C) 2023-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_ISWPUNCT],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+ dnl <wctype.h> redefines iswpunct already.
+ REPLACE_ISWPUNCT="$REPLACE_ISWCNTRL"
+ else
+ AC_CACHE_CHECK([whether iswpunct is consistent with ispunct],
+ [gl_cv_func_iswpunct_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <ctype.h>
+#include <wchar.h>
+#include <wctype.h>
+int
+main (int argc, char *argv[])
+{
+ int result = 0;
+ /* This fails on Android 11. */
+ if ((! iswpunct ('\`')) != (! ispunct ('\`')))
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_iswpunct_works=yes],
+ [gl_cv_func_iswpunct_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ android*) gl_cv_func_iswpunct_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_iswpunct_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_iswpunct_works" in
+ *yes) ;;
+ *) REPLACE_ISWPUNCT=1 ;;
+ esac
+ fi
+])