After this patch in glibc http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=dbb0472f054a4241feec09af30db850dd4d18a7b it is necessary to define _GNU_SOURCE to ensure that wcpcpy and wcpncpy are declared.
2011-04-01 Bruno Haible <[email protected]> wcpcpy, wcpncpy: Ensure declaration on glibc >= 2.13 systems. * m4/wcpcpy.m4 (gl_FUNC_WCPCPY): Require AC_USE_SYSTEM_EXTENSIONS. * m4/wcpncpy.m4 (gl_FUNC_WCPNCPY): Likewise. * modules/wcpcpy (Depends-on): Add extensions. * modules/wcpncpy (Depends-on): Likewise. * doc/posix-functions/wcpcpy.texi: Mention missing declaration on glibc systems. * doc/posix-functions/wcpncpy.texi: Likewise. * doc/posix-functions/wcwidth.texi: Likewise. --- doc/posix-functions/wcpcpy.texi.orig Fri Apr 1 23:20:40 2011 +++ doc/posix-functions/wcpcpy.texi Fri Apr 1 23:15:27 2011 @@ -12,6 +12,9 @@ This function is missing on some platforms: MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS. +@item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.13. @end itemize Portability problems not fixed by Gnulib: --- doc/posix-functions/wcpncpy.texi.orig Fri Apr 1 23:20:40 2011 +++ doc/posix-functions/wcpncpy.texi Fri Apr 1 23:15:26 2011 @@ -12,6 +12,9 @@ This function is missing on some platforms: MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS. +@item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.13. @end itemize Portability problems not fixed by Gnulib: --- doc/posix-functions/wcwidth.texi.orig Fri Apr 1 23:20:40 2011 +++ doc/posix-functions/wcwidth.texi Fri Apr 1 23:15:26 2011 @@ -12,6 +12,9 @@ This function is missing on some platforms: IRIX 5.3, Solaris 2.5.1, mingw, BeOS. @item +This function is not declared (without @code{-D_GNU_SOURCE}) on some platforms: +glibc 2.8. +@item This function handles combining characters in UTF-8 locales incorrectly on some platforms: MacOS X 10.3. --- m4/wcpcpy.m4.orig Fri Apr 1 23:20:40 2011 +++ m4/wcpcpy.m4 Fri Apr 1 23:10:01 2011 @@ -1,4 +1,4 @@ -# wcpcpy.m4 serial 1 +# wcpcpy.m4 serial 2 dnl Copyright (C) 2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,10 @@ AC_DEFUN([gl_FUNC_WCPCPY], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + dnl Persuade glibc <wchar.h> to declare wcpcpy(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([wcpcpy]) if test $ac_cv_func_wcpcpy = no; then HAVE_WCPCPY=0 --- m4/wcpncpy.m4.orig Fri Apr 1 23:20:40 2011 +++ m4/wcpncpy.m4 Fri Apr 1 23:10:01 2011 @@ -1,4 +1,4 @@ -# wcpncpy.m4 serial 1 +# wcpncpy.m4 serial 2 dnl Copyright (C) 2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,10 @@ AC_DEFUN([gl_FUNC_WCPNCPY], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + + dnl Persuade glibc <wchar.h> to declare wcpncpy(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_FUNCS_ONCE([wcpncpy]) if test $ac_cv_func_wcpncpy = no; then HAVE_WCPNCPY=0 --- modules/wcpcpy.orig Fri Apr 1 23:20:40 2011 +++ modules/wcpcpy Fri Apr 1 23:10:25 2011 @@ -13,6 +13,7 @@ m4/wcpcpy.m4 Depends-on: +extensions wchar configure.ac: --- modules/wcpncpy.orig Fri Apr 1 23:20:40 2011 +++ modules/wcpncpy Fri Apr 1 23:10:38 2011 @@ -7,6 +7,7 @@ m4/wcpncpy.m4 Depends-on: +extensions wchar configure.ac: -- In memoriam Karim Mohammedzadeh <http://en.wikipedia.org/wiki/Karim_Mohammedzadeh>
