]> Savannah Git Hosting - gnulib.git/commitdiff
fnmatch: Ensure that on Cygwin ≥ 3.5.0, Cygwin's native fnmatch is used.
authorBruno Haible <bruno@clisp.org>
Fri, 28 Jul 2023 19:36:51 +0000 (21:36 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 28 Jul 2023 19:36:51 +0000 (21:36 +0200)
Tested by Corinna Vinschen in
<https://cygwin.com/pipermail/cygwin/2023-July/254036.html>.

* m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): On Cygwin, don't force
REPLACE_FNMATCH to 1 just because wchar_t is small.

ChangeLog
m4/fnmatch.m4

index a4d245537aa8ad858cc92b5026f7d64b1ddb5779..02e7fca1df9ae2e983574d5a23f0fec75bacf222 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-07-28  Bruno Haible  <bruno@clisp.org>
+
+       fnmatch: Ensure that on Cygwin ≥ 3.5.0, Cygwin's native fnmatch is used.
+       Tested by Corinna Vinschen in
+       <https://cygwin.com/pipermail/cygwin/2023-July/254036.html>.
+       * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): On Cygwin, don't force
+       REPLACE_FNMATCH to 1 just because wchar_t is small.
+
 2023-07-28  Bruno Haible  <bruno@clisp.org>
 
        posixcheck: Fix dependencies.
index 2e1442eff7494ca8378844ea3889a1a9f654882a..e99737a476258e7fa6455c0519fb0243ea0e14cd 100644 (file)
@@ -1,4 +1,4 @@
-# Check for fnmatch - serial 18  -*- coding: utf-8 -*-
+# Check for fnmatch - serial 19  -*- coding: utf-8 -*-
 
 # Copyright (C) 2000-2007, 2009-2023 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
   m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX])
 
   AC_REQUIRE([gl_FNMATCH_H])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   gl_fnmatch_required_lowercase=`
     echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]'
   `
@@ -164,7 +164,17 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
     dnl This is due to wchar_t being only 16 bits wide.
     AC_REQUIRE([gl_UCHAR_H])
     if test $SMALL_WCHAR_T = 1; then
-      REPLACE_FNMATCH=1
+      case "$host_os" in
+        cygwin*)
+          dnl On Cygwin < 3.5.0, the above $gl_fnmatch_result came out as 'no',
+          dnl On Cygwin >= 3.5.0, fnmatch supports all Unicode characters,
+          dnl despite wchar_t being only 16 bits wide (because internally it
+          dnl works on wint_t values).
+          ;;
+        *)
+          REPLACE_FNMATCH=1
+          ;;
+      esac
     fi
   fi
   if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then