X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Ffnmatch.m4;h=d638f67a80f94f12abb31ef3e653a3495df1a34f;hb=ad7e0cc967251bc0d09999503a51e5fbcfac021d;hp=bca15add15dc7add93ebd4588b7778b56c411225;hpb=44d7c1c1f004fa9bfb8ec3948de2671a7958cf5b;p=gnulib.git diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index bca15add1..d638f67a8 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -1,13 +1,14 @@ # Check for fnmatch. -# This is a modified version of autoconf's AC_FUNC_FNMATCH. -# This file should be simplified after Autoconf 2.57 is required. - -# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# Autoconf defines AC_FUNC_FNMATCH, but that is obsolescent. +# New applications should use the macros below instead. + # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE) # ------------------------------------------------------------------------- # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise @@ -27,9 +28,15 @@ AC_DEFUN([_AC_FUNC_FNMATCH_IF], # include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) + static int + fnm (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags); + } ], [exit - (!(y ("a*", "abc", 0) + (!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH + && y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) @@ -54,10 +61,9 @@ AS_IF([test $$2 = yes], [$3], [$4]) # ------------------ # Prepare the replacement of fnmatch. AC_DEFUN([_AC_LIBOBJ_FNMATCH], -[AC_REQUIRE([AC_C_CONST])dnl -AC_REQUIRE([AC_FUNC_ALLOCA])dnl +[AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl -AC_CHECK_DECLS([getenv]) +AC_CHECK_DECLS([isblank], [], [], [#include ]) AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) AC_CHECK_HEADERS([wchar.h wctype.h]) AC_LIBOBJ([fnmatch])