From aca6ea6586fb2368e6659388f55ba3d374913a86 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 3 Jun 2015 13:57:40 +0000 Subject: Fix fnmatch wmemchr namespace (bug 18468). fnmatch brings in references to wmemchr, which isn't in all the standards that contain fnmatch, resulting in linknamespace test failures. This patch fixes this in the usual way, making wmemchr into a weak alias for __wmemchr. Tested for x86_64 and x86 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #18468] * wcsmbs/wmemchr.c (wmemchr): Rename to __wmemchr and define as weak alias of __wmemchr. Use libc_hidden_weak. * include/wchar.h (__wmemchr): Declare. Use libc_hidden_proto. * posix/fnmatch.c [HANDLE_MULTIBYTE] (MEMCHR): Use __wmemchr instead of wmemchr. --- include/wchar.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/wchar.h b/include/wchar.h index 7b5e1a16a3..eb1cb0da04 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -87,7 +87,7 @@ libc_hidden_proto (wcsspn) libc_hidden_proto (wcschr) /* The C++ overloading of wcschr means we have to repeat the type to declare __wcschr instead of using typeof, to avoid errors in C++ - tests. */ + tests. The same applies to __wmemchr. */ extern wchar_t *__wcschr (const wchar_t *__wcs, wchar_t __wc) __THROW __attribute_pure__; libc_hidden_proto (__wcschr) @@ -95,7 +95,10 @@ libc_hidden_proto (wcscoll) libc_hidden_proto (wcspbrk) extern typeof (wmemset) __wmemset; +extern wchar_t *__wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) + __THROW __attribute_pure__; libc_hidden_proto (wmemchr) +libc_hidden_proto (__wmemchr) libc_hidden_proto (wmemset) libc_hidden_proto (__wmemset) -- cgit v1.2.3