cwchar: New.
authorPaolo Carlini <pcarlini@suse.de>
Fri, 3 Feb 2006 21:40:07 +0000 (21:40 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 3 Feb 2006 21:40:07 +0000 (21:40 +0000)
2006-02-03  Paolo Carlini  <pcarlini@suse.de>

* include/tr1/cwchar: New.
* include/tr1/cwctype: Likewise.
* include/tr1/wchar.h: Likewise.
* include/tr1/wctype.h: Likewise.
* include/Makefile.am: Add.
* testsuite/tr1/8_c_compatibility/cinttypes/functions: New.
* testsuite/tr1/8_c_compatibility/cwctype/functions.cc: Likewise.
* testsuite/tr1/headers.cc: Update.
* acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add <wchar.h> and
<wctype.h> checks.
* docs/html/ext/tr1.html: Update.
* include/Makefile.in: Regenerate.
* config.h.in: Likewise.
* configure: Likewise.

* testsuite/tr1/8_c_compatibility/cctype/functions.cc: Cosmetic tweak.

From-SVN: r110562

15 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/docs/html/ext/tr1.html
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/tr1/cwchar [new file with mode: 0644]
libstdc++-v3/include/tr1/cwctype [new file with mode: 0644]
libstdc++-v3/include/tr1/wchar.h [new file with mode: 0644]
libstdc++-v3/include/tr1/wctype.h [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc
libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/headers.cc

index b16e15db4a564b5145b19e594c067103532a376c..6c6a71aaa3dac0373894a28f8a1ce3ca6e9027fe 100644 (file)
@@ -1,3 +1,22 @@
+2006-02-03  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1/cwchar: New.
+       * include/tr1/cwctype: Likewise.
+       * include/tr1/wchar.h: Likewise.
+       * include/tr1/wctype.h: Likewise.
+       * include/Makefile.am: Add.
+       * testsuite/tr1/8_c_compatibility/cinttypes/functions: New.
+       * testsuite/tr1/8_c_compatibility/cwctype/functions.cc: Likewise.
+       * testsuite/tr1/headers.cc: Update.
+       * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add <wchar.h> and
+       <wctype.h> checks.
+       * docs/html/ext/tr1.html: Update.
+       * include/Makefile.in: Regenerate.
+       * config.h.in: Likewise.
+       * configure: Likewise.
+
+       * testsuite/tr1/8_c_compatibility/cctype/functions.cc: Cosmetic tweak.
+
 2006-02-02  Paolo Carlini  <pcarlini@suse.de>
 
        * include/tr1/cfloat: New.
index e83658f283a86f813cccf3fd4207d62ad047f769..a582d611dd37ee85417d7dcaff87335375f07ef6 100644 (file)
@@ -1190,13 +1190,10 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
                   [intmax_t i, numer, denom, base;
                    const char* s;
                    char** endptr;
-                   intmax_t ret;
-                   uintmax_t uret;
-                   imaxdiv_t dret;
-                   ret = imaxabs(i);
-                   dret = imaxdiv(numer, denom);
+                   intmax_t ret = imaxabs(i);
+                   imaxdiv_t dret = imaxdiv(numer, denom);
                    ret = strtoimax(s, endptr, base);
-                   uret = strtoumax(s, endptr, base);
+                   uintmax_t uret = strtoumax(s, endptr, base);
                   ],[ac_c99_inttypes_tr1=yes], [ac_c99_inttypes_tr1=no])
   fi
   AC_MSG_RESULT($ac_c99_inttypes_tr1)
@@ -1206,6 +1203,50 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
               <tr1/cinttypes> in namespace std::tr1.])
   fi
 
+  # Check for the existence of <wchar.h> functions.
+  AC_MSG_CHECKING([for ISO C99 support to TR1 in <wchar.h>])
+  AC_CACHE_VAL(ac_c99_wchar_tr1, [
+  AC_TRY_COMPILE([#include <wchar.h>
+                 #include <stdio.h>
+                 #include <stdarg.h>],
+                [const wchar_t* nptr;
+                 const wchar_t* format;
+                 const wchar_t* s;
+                 wchar_t** endptr;
+                 FILE* stream;
+                 va_list arg;
+                 int base;
+                 float fret = wcstof(nptr, endptr);
+                 long double ldret = wcstold(nptr, endptr);
+                 int ret = vfwscanf(stream, format, arg);
+                 ret = vswscanf(s, format, arg);
+                 ret = vwscanf(format, arg);
+                 long long llret = wcstoll(nptr, endptr, base);
+                 unsigned long long ullret = wcstoull(nptr, endptr, base);
+                ],[ac_c99_wchar_tr1=yes], [ac_c99_wchar_tr1=no])
+  ])
+  AC_MSG_RESULT($ac_c99_wchar_tr1)
+  if test x"$ac_c99_wchar_tr1" = x"yes"; then
+    AC_DEFINE(_GLIBCXX_USE_C99_WCHAR_TR1, 1,
+              [Define if C99 functions in <wchar.h> should be imported in
+             <tr1/cwchar> in namespace std::tr1.])
+  fi
+
+  # Check for the existence of <wctype.h> functions.
+  AC_MSG_CHECKING([for ISO C99 support to TR1 in <wctype.h>])
+  AC_CACHE_VAL(ac_c99_wctype_tr1, [
+  AC_TRY_COMPILE([#include <wctype.h>],
+                [wint_t ch;
+                 int ret = iswblank(ch);
+                ],[ac_c99_wctype_tr1=yes], [ac_c99_wctype_tr1=no])
+  ])
+  AC_MSG_RESULT($ac_c99_wctype_tr1)
+  if test x"$ac_c99_wctype_tr1" = x"yes"; then
+    AC_DEFINE(_GLIBCXX_USE_C99_WCTYPE_TR1, 1,
+              [Define if C99 functions in <wctype.h> should be imported in
+             <tr1/cwctype> in namespace std::tr1.])
+  fi
+
   AC_LANG_RESTORE
 ])
 
index d940e6189c753848c441ca906623e7c64a6c3ec8..0f210cbcc9f1a057874400ac573054714e2e775b 100644 (file)
    namespace std::tr1. */
 #undef _GLIBCXX_USE_C99_STDINT_TR1
 
+/* Define if C99 functions in <wchar.h> should be imported in <tr1/cwchar> in
+   namespace std::tr1. */
+#undef _GLIBCXX_USE_C99_WCHAR_TR1
+
+/* Define if C99 functions in <wctype.h> should be imported in <tr1/cwctype>
+   in namespace std::tr1. */
+#undef _GLIBCXX_USE_C99_WCTYPE_TR1
+
 /* Define if iconv and related functions exist and are usable. */
 #undef _GLIBCXX_USE_ICONV
 
index dfc5b4ab0e2b1be5399f8b252319bf56161c85e8..5ce6410135fd719c4935ed90f6f46da3473a999f 100755 (executable)
@@ -30629,13 +30629,10 @@ main ()
 intmax_t i, numer, denom, base;
                    const char* s;
                    char** endptr;
-                   intmax_t ret;
-                   uintmax_t uret;
-                   imaxdiv_t dret;
-                   ret = imaxabs(i);
-                   dret = imaxdiv(numer, denom);
+                   intmax_t ret = imaxabs(i);
+                   imaxdiv_t dret = imaxdiv(numer, denom);
                    ret = strtoimax(s, endptr, base);
-                   uret = strtoumax(s, endptr, base);
+                   uintmax_t uret = strtoumax(s, endptr, base);
 
   ;
   return 0;
@@ -30682,6 +30679,154 @@ _ACEOF
 
   fi
 
+  # Check for the existence of <wchar.h> functions.
+  echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <wchar.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <wchar.h>... $ECHO_C" >&6
+  if test "${ac_c99_wchar_tr1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <wchar.h>
+                 #include <stdio.h>
+                 #include <stdarg.h>
+int
+main ()
+{
+const wchar_t* nptr;
+                 const wchar_t* format;
+                 const wchar_t* s;
+                 wchar_t** endptr;
+                 FILE* stream;
+                 va_list arg;
+                 int base;
+                 float fret = wcstof(nptr, endptr);
+                 long double ldret = wcstold(nptr, endptr);
+                 int ret = vfwscanf(stream, format, arg);
+                 ret = vswscanf(s, format, arg);
+                 ret = vwscanf(format, arg);
+                 long long llret = wcstoll(nptr, endptr, base);
+                 unsigned long long ullret = wcstoull(nptr, endptr, base);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_c99_wchar_tr1=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_wchar_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+  echo "$as_me:$LINENO: result: $ac_c99_wchar_tr1" >&5
+echo "${ECHO_T}$ac_c99_wchar_tr1" >&6
+  if test x"$ac_c99_wchar_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_WCHAR_TR1 1
+_ACEOF
+
+  fi
+
+  # Check for the existence of <wctype.h> functions.
+  echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in <wctype.h>" >&5
+echo $ECHO_N "checking for ISO C99 support to TR1 in <wctype.h>... $ECHO_C" >&6
+  if test "${ac_c99_wctype_tr1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <wctype.h>
+int
+main ()
+{
+wint_t ch;
+                 int ret = iswblank(ch);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_c99_wctype_tr1=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_c99_wctype_tr1=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+  echo "$as_me:$LINENO: result: $ac_c99_wctype_tr1" >&5
+echo "${ECHO_T}$ac_c99_wctype_tr1" >&6
+  if test x"$ac_c99_wctype_tr1" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_WCTYPE_TR1 1
+_ACEOF
+
+  fi
+
   ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
index 609656cdde7e54f690e57f3b67d57fae33888536..467226076766cccaef1fbd8fe6e723be4bd8e63a 100644 (file)
@@ -2187,73 +2187,73 @@ release.
     <tr>
       <td>8.30</td>
       <td>Additions to header <code>&lt;cwchar&gt;</code></td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.30.1</td>
       <td>Synopsis</td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.30.2</td>
       <td>Definitions</td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.30.3</td>
       <td>Additional wide format specifiers</td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.31</td>
       <td>Additions to header <code>&lt;wchar.h&gt;</code></td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.32</td>
       <td>Additions to header <code>&lt;cwctype&gt;</code></td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.32.1</td>
       <td>Synopsis</td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.32.2</td>
       <td>Function <code>iswblank</code></td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
     <tr>
       <td>8.33</td>
       <td>Additions to header <code>&lt;wctype.h&gt;</code></td>
+      <td>done</td>
       <td></td>
       <td></td>
-      <td>missing</td>
       <td></td>
     </tr>
   </tbody>
@@ -2307,7 +2307,7 @@ permitted in any medium, provided this notice is preserved.
 <table width="100%" border="0">
 <tr>
   <td>
-    <!-- IGNORE DIFF -->Last modified 2006-02-02
+    <!-- IGNORE DIFF -->Last modified 2006-02-03
   </td>
   <td align="right" valign="bottom">
     <a href="http://validator.w3.org/check/referer">
index 5fcab8f41bf5b05a8837edab4af6d209708537dd..4e06400b286a238781c9efc82487d78ed083da58 100644 (file)
@@ -494,6 +494,8 @@ tr1_headers = \
        ${tr1_srcdir}/cstdarg \
        ${tr1_srcdir}/cstdint \
        ${tr1_srcdir}/ctype.h \
+       ${tr1_srcdir}/cwchar \
+       ${tr1_srcdir}/cwctype \
        ${tr1_srcdir}/fenv.h \
        ${tr1_srcdir}/float.h \
        ${tr1_srcdir}/functional \
@@ -514,7 +516,9 @@ tr1_headers = \
        ${tr1_srcdir}/type_traits_fwd.h \
        ${tr1_srcdir}/unordered_set \
        ${tr1_srcdir}/unordered_map \
-       ${tr1_srcdir}/utility
+       ${tr1_srcdir}/utility \
+       ${tr1_srcdir}/wchar.h \
+       ${tr1_srcdir}/wctype.h
 
 
 # This is the common subset of files that all three "C" header models use.
index 1568c57616ea7ec098283c464108a94594ba9fa1..a50108c801c7c7e7836d1789d9246fa13ab4ecdf 100644 (file)
@@ -711,6 +711,8 @@ tr1_headers = \
        ${tr1_srcdir}/cstdarg \
        ${tr1_srcdir}/cstdint \
        ${tr1_srcdir}/ctype.h \
+       ${tr1_srcdir}/cwchar \
+       ${tr1_srcdir}/cwctype \
        ${tr1_srcdir}/fenv.h \
        ${tr1_srcdir}/float.h \
        ${tr1_srcdir}/functional \
@@ -731,7 +733,9 @@ tr1_headers = \
        ${tr1_srcdir}/type_traits_fwd.h \
        ${tr1_srcdir}/unordered_set \
        ${tr1_srcdir}/unordered_map \
-       ${tr1_srcdir}/utility
+       ${tr1_srcdir}/utility \
+       ${tr1_srcdir}/wchar.h \
+       ${tr1_srcdir}/wctype.h
 
 
 # This is the common subset of files that all three "C" header models use.
diff --git a/libstdc++-v3/include/tr1/cwchar b/libstdc++-v3/include/tr1/cwchar
new file mode 100644 (file)
index 0000000..608022a
--- /dev/null
@@ -0,0 +1,96 @@
+// TR1 cwchar -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file 
+ *  This is a TR1 C++ Library header. 
+ */
+
+#ifndef _TR1_CWCHAR
+#define _TR1_CWCHAR 1
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_USE_WCHAR_T
+
+#include <cwchar>
+
+#if _GLIBCXX_USE_C99_WCHAR_TR1
+
+#undef wcstof
+#undef wcstold
+#undef wcstoll
+#undef wcstoull
+#undef vfwscanf
+#undef vswscanf
+#undef vwscanf
+
+_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+  extern "C" long double
+    (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
+  using ::wcstold;
+#endif
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+  extern "C" long long int
+    (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
+  extern "C" unsigned long long int
+    (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+  using ::wcstoll;
+  using ::wcstoull;
+#endif
+
+_GLIBCXX_END_NAMESPACE
+
+// namespace std::tr1
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE(tr1)
+
+  using ::wcstof;
+  using ::__gnu_cxx::wcstold;
+  using ::__gnu_cxx::wcstoll;
+  using ::__gnu_cxx::wcstoull;
+
+  using ::vfwscanf;
+  using ::vswscanf;
+  using ::vwscanf;
+
+_GLIBCXX_END_NAMESPACE
+}
+
+#endif
+
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/tr1/cwctype b/libstdc++-v3/include/tr1/cwctype
new file mode 100644 (file)
index 0000000..3e94f27
--- /dev/null
@@ -0,0 +1,61 @@
+// TR1 cwctype -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file 
+ *  This is a TR1 C++ Library header. 
+ */
+
+#ifndef _TR1_CWCTYPE
+#define _TR1_CWCTYPE 1
+
+#include <bits/c++config.h>
+
+#if _GLIBCXX_USE_WCHAR_T
+
+#include <cwctype>
+
+#if _GLIBCXX_USE_C99_WCTYPE_TR1
+
+#undef iswblank
+
+// namespace std::tr1
+namespace std
+{
+_GLIBCXX_BEGIN_NAMESPACE(tr1)
+
+  using ::iswblank;
+
+_GLIBCXX_END_NAMESPACE
+}
+
+#endif
+
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/tr1/wchar.h b/libstdc++-v3/include/tr1/wchar.h
new file mode 100644 (file)
index 0000000..295b6a9
--- /dev/null
@@ -0,0 +1,39 @@
+// TR1 wchar.h -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file 
+ *  This is a TR1 C++ Library header. 
+ */
+
+#ifndef _TR1_WCHAR_H
+#define _TR1_WCHAR_H 1
+
+#include <tr1/cwchar>
+
+#endif
diff --git a/libstdc++-v3/include/tr1/wctype.h b/libstdc++-v3/include/tr1/wctype.h
new file mode 100644 (file)
index 0000000..0834109
--- /dev/null
@@ -0,0 +1,39 @@
+// TR1 wctype.h -*- C++ -*-
+
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file 
+ *  This is a TR1 C++ Library header. 
+ */
+
+#ifndef _TR1_WCTYPE_H
+#define _TR1_WCTYPE_H 1
+
+#include <tr1/cwctype>
+
+#endif
index 57d81f1ffc9fad2bd60a91e89ecd0b4c125ca88e..35c34f412d5f8c708a7c2f7099dba56ecad122e2 100644 (file)
@@ -28,8 +28,8 @@ void test01()
 {
 #if _GLIBCXX_USE_C99_CTYPE_TR1
 
-  int ch = 0, r;
-  r = std::tr1::isblank(ch);
+  int ch = 0, ret;
+  ret = std::tr1::isblank(ch);
 
 #endif
 }
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc
new file mode 100644 (file)
index 0000000..577868a
--- /dev/null
@@ -0,0 +1,63 @@
+// { dg-do compile }
+
+// 2006-02-03  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 8.6 Additions to header <cwchar>
+
+#include <tr1/cwchar>
+#include <cstdio>
+#include <cstdarg>
+
+#if _GLIBCXX_USE_WCHAR_T
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_WCHAR_TR1
+
+  const wchar_t* nptr = 0;
+  const wchar_t* format = 0;
+  const wchar_t* s = 0;
+  wchar_t** endptr = 0;
+  FILE* stream = 0;
+  std::va_list arg = 0;
+
+  float fret;
+  long double ldret;
+  int ret;
+
+  fret = std::tr1::wcstof(nptr, endptr);
+  ldret = std::tr1::wcstold(nptr, endptr);
+  ret = std::tr1::vfwscanf(stream, format, arg);
+  ret = std::tr1::vswscanf(s, format, arg);
+  ret = std::tr1::vwscanf(format, arg);
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+  int base = 0;
+  long long llret;
+  unsigned long long ullret;
+  llret = std::tr1::wcstoll(nptr, endptr, base);
+  ullret = std::tr1::wcstoull(nptr, endptr, base);
+#endif
+
+#endif
+}
+
+#endif
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc
new file mode 100644 (file)
index 0000000..5dc5a84
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-do compile }
+
+// 2006-02-03  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2006 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 8.32 Additions to header <cwctype>
+
+#include <tr1/cwctype>
+
+#if _GLIBCXX_USE_WCHAR_T
+
+void test01()
+{
+#if _GLIBCXX_USE_C99_WCTYPE_TR1
+
+  std::wint_t ch = 0;
+  int ret;
+  ret = std::tr1::iswblank(ch);
+
+#endif
+}
+
+#endif
index 510b29d48c0ce7031b8b8f4017ee0d31f854ddad..4b070036e0b21a12f842b34e7d60247dc92dc647 100644 (file)
@@ -30,6 +30,8 @@
 #include <tr1/cstdarg>
 #include <tr1/cstdint>
 #include <tr1/ctype.h>
+#include <tr1/cwchar>
+#include <tr1/cwctype>
 #include <tr1/fenv.h>
 #include <tr1/float.h>
 #include <tr1/functional>
@@ -44,3 +46,5 @@
 #include <tr1/unordered_set>
 #include <tr1/unordered_map>
 #include <tr1/utility>
+#include <tr1/wchar.h>
+#include <tr1/wctype.h>