On Tue, Sep 20, 2011 at 12:01:18PM +0200, Stefan Sperling wrote: > wscanf based on our scanf implementation. The delta from narrow > to wide character support was obtained from FreeBSD and modified > to fit our code. > > Does not include a libc bump yet!
Here are corresponding libstdc++ changes, also without bumps. The gcc3 version will have to be revisited once we also get wcsftime. But for now it should work like this (the configure script doesn't define _GLIBCPP_USE_WCHAR_T unless it finds all wchar functions it wants). Not sure if the c_compatibility change is really needed. We didn't update it for wprintf (by accident?) As with wprintf, no actual changes for gcc2 -- we'll just bump the lib for safety. Can someone run this (together with the libc wscanf diff) through a build on gcc2 and gcc3 architectures? Index: gcc/libstdc++-v3/include/c_compatibility/wchar.h =================================================================== RCS file: /cvs/src/gnu/gcc/libstdc++-v3/include/c_compatibility/wchar.h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 wchar.h --- gcc/libstdc++-v3/include/c_compatibility/wchar.h 15 Oct 2009 17:11:32 -0000 1.1.1.1 +++ gcc/libstdc++-v3/include/c_compatibility/wchar.h 20 Sep 2011 14:36:35 -0000 @@ -45,32 +45,24 @@ using std::fgetws; using std::fputwc; using std::fputws; using std::fwide; -#if !defined(__OpenBSD__) using std::fwprintf; using std::fwscanf; using std::swprintf; using std::swscanf; using std::vfwprintf; -#endif #if _GLIBCXX_HAVE_VFWSCANF using std::vfwscanf; #endif -#if !defined(__OpenBSD__) using std::vswprintf; -#endif #if _GLIBCXX_HAVE_VSWSCANF using std::vswscanf; #endif -#if !defined(__OpenBSD__) using std::vwprintf; -#endif #if _GLIBCXX_HAVE_VWSCANF using std::vwscanf; #endif -#if !defined(__OpenBSD__) using std::wprintf; using std::wscanf; -#endif using std::getwc; using std::getwchar; using std::mbsinit; Index: gcc/libstdc++-v3/include/c_std/std_cwchar.h =================================================================== RCS file: /cvs/src/gnu/gcc/libstdc++-v3/include/c_std/std_cwchar.h,v retrieving revision 1.4 diff -u -p -r1.4 std_cwchar.h --- gcc/libstdc++-v3/include/c_std/std_cwchar.h 28 Apr 2011 17:39:59 -0000 1.4 +++ gcc/libstdc++-v3/include/c_std/std_cwchar.h 20 Sep 2011 13:54:40 -0000 @@ -152,9 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) using ::fputws; using ::fwide; using ::fwprintf; -#if !defined(__OpenBSD__) using ::fwscanf; -#endif using ::getwc; using ::getwchar; using ::mbrlen; @@ -164,9 +162,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) using ::putwc; using ::putwchar; using ::swprintf; -#if !defined(__OpenBSD__) using ::swscanf; -#endif using ::ungetwc; using ::vfwprintf; #if _GLIBCXX_HAVE_VFWSCANF @@ -209,9 +205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) using ::wmemmove; using ::wmemset; using ::wprintf; -#if !defined(__OpenBSD__) using ::wscanf; -#endif using ::wcschr; Index: lib/libstdc++/libstdc++/include/c_std/std_cwchar.h =================================================================== RCS file: /cvs/src/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h,v retrieving revision 1.4 diff -u -p -r1.4 std_cwchar.h --- lib/libstdc++/libstdc++/include/c_std/std_cwchar.h 28 Apr 2011 17:41:37 -0000 1.4 +++ lib/libstdc++/libstdc++/include/c_std/std_cwchar.h 20 Sep 2011 14:30:48 -0000 @@ -141,18 +141,18 @@ namespace std using ::fputws; using ::fwide; #if defined(_GLIBCPP_USE_WCHAR_T) + using ::wcsftime; +#endif using ::fwscanf; using ::swscanf; using ::vfwscanf; using ::vswscanf; using ::vwscanf; - using ::wcsftime; using ::wcstod; using ::wcstof; using ::wcstol; using ::wcstoul; using ::wscanf; -#endif using ::fwprintf; using ::swprintf; using ::vfwprintf; Index: lib/libstdc++-v3/config.h =================================================================== RCS file: /cvs/src/gnu/lib/libstdc++-v3/config.h,v retrieving revision 1.2 diff -u -p -r1.2 config.h --- lib/libstdc++-v3/config.h 9 May 2010 09:46:26 -0000 1.2 +++ lib/libstdc++-v3/config.h 20 Sep 2011 14:14:33 -0000 @@ -382,13 +382,13 @@ #define HAVE_UNISTD_H 1 /* Defined if vfwscanf exists. */ -/* #undef HAVE_VFWSCANF */ +#define HAVE_VFWSCANF 1 /* Defined if vswscanf exists. */ -/* #undef HAVE_VSWSCANF */ +#define HAVE_VSWSCANF 1 /* Defined if vwscanf exists. */ -/* #undef HAVE_VWSCANF */ +#define HAVE_VWSCANF 1 /* Define to 1 if you have the <wchar.h> header file. */ #define HAVE_WCHAR_H 1
