"Robert Dahlem" <[EMAIL PROTECTED]> writes:

> Under ReliantUnix 5.43 wmemchr() and wmemcpy() are not in libc but in libw.

Thanks for the bug report.  I'd rather not hassle with -lw if I can
avoid it.  We toyed with -lw last year (to get wcslen on Solaris
2.5.1) but if memory served it's not always installed, which meant
that programs built on one host wouldn't run on another.

wmenchr and wmemcpy are in the C99 standard, so eventually they should
be moved into the C Library on your platform.  In the meantime, the
following patch (which I installed) will let coreutils build, albeit
only with unibyte support for file-name-matching primitives.

2004-08-11  Paul Eggert  <[EMAIL PROTECTED]>

        * lib/fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
        wmemchr or wmemcpy.  Problem reported by Robert Dahlem
        for Reliant Unix 5.43.
        * m4/fnmatch.m4 (_AC_LIBOBJ_FNMATCH): Check for wmemchr and wmemcpy.

Index: lib/fnmatch.c
===================================================================
RCS file: /home/eggert/coreutils/cu/lib/fnmatch.c,v
retrieving revision 1.28
diff -p -u -r1.28 fnmatch.c
--- lib/fnmatch.c       2 Aug 2004 18:10:35 -0000       1.28
+++ lib/fnmatch.c       11 Aug 2004 17:48:12 -0000
@@ -39,7 +39,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
+#define WIDE_CHAR_SUPPORT \
+  (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC \
+   && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
 
 /* For platform which support the ISO C amendement 1 functionality we
    support user defined character classes.  */
Index: m4/fnmatch.m4
===================================================================
RCS file: /home/eggert/coreutils/cu/m4/fnmatch.m4,v
retrieving revision 1.17
diff -p -u -r1.17 fnmatch.m4
--- m4/fnmatch.m4       10 Aug 2004 05:43:13 -0000      1.17
+++ m4/fnmatch.m4       11 Aug 2004 17:47:41 -0000
@@ -3,7 +3,7 @@
 # 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-2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@ AC_DEFUN([_AC_LIBOBJ_FNMATCH],
 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
 AC_CHECK_DECLS([getenv])
-AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
+AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy])
 AC_CHECK_HEADERS([wchar.h wctype.h])
 AC_LIBOBJ([fnmatch])
 FNMATCH_H=fnmatch.h


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to