From af66a43e88af67e5650e5a1f7f82428710988702 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 3 Feb 2006 21:40:07 +0000 Subject: [PATCH] cwchar: New. 2006-02-03 Paolo Carlini * 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 and 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 --- libstdc++-v3/ChangeLog | 19 +++ libstdc++-v3/acinclude.m4 | 53 +++++- libstdc++-v3/config.h.in | 8 + libstdc++-v3/configure | 157 +++++++++++++++++- libstdc++-v3/docs/html/ext/tr1.html | 20 +-- libstdc++-v3/include/Makefile.am | 6 +- libstdc++-v3/include/Makefile.in | 6 +- libstdc++-v3/include/tr1/cwchar | 96 +++++++++++ libstdc++-v3/include/tr1/cwctype | 61 +++++++ libstdc++-v3/include/tr1/wchar.h | 39 +++++ libstdc++-v3/include/tr1/wctype.h | 39 +++++ .../tr1/8_c_compatibility/cctype/functions.cc | 4 +- .../tr1/8_c_compatibility/cwchar/functions.cc | 63 +++++++ .../8_c_compatibility/cwctype/functions.cc | 40 +++++ libstdc++-v3/testsuite/tr1/headers.cc | 4 + 15 files changed, 589 insertions(+), 26 deletions(-) create mode 100644 libstdc++-v3/include/tr1/cwchar create mode 100644 libstdc++-v3/include/tr1/cwctype create mode 100644 libstdc++-v3/include/tr1/wchar.h create mode 100644 libstdc++-v3/include/tr1/wctype.h create mode 100644 libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc create mode 100644 libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b16e15db4a56..6c6a71aaa3da 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,22 @@ +2006-02-03 Paolo Carlini + + * 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 and + 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 * include/tr1/cfloat: New. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index e83658f283a8..a582d611dd37 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -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], [ in namespace std::tr1.]) fi + # Check for the existence of functions. + AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) + AC_CACHE_VAL(ac_c99_wchar_tr1, [ + AC_TRY_COMPILE([#include + #include + #include ], + [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 should be imported in + in namespace std::tr1.]) + fi + + # Check for the existence of functions. + AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) + AC_CACHE_VAL(ac_c99_wctype_tr1, [ + AC_TRY_COMPILE([#include ], + [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 should be imported in + in namespace std::tr1.]) + fi + AC_LANG_RESTORE ]) diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index d940e6189c75..0f210cbcc9f1 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -719,6 +719,14 @@ namespace std::tr1. */ #undef _GLIBCXX_USE_C99_STDINT_TR1 +/* Define if C99 functions in should be imported in in + namespace std::tr1. */ +#undef _GLIBCXX_USE_C99_WCHAR_TR1 + +/* Define if C99 functions in should be imported in + in namespace std::tr1. */ +#undef _GLIBCXX_USE_C99_WCTYPE_TR1 + /* Define if iconv and related functions exist and are usable. */ #undef _GLIBCXX_USE_ICONV diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index dfc5b4ab0e2b..5ce6410135fd 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -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 functions. + echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in " >&5 +echo $ECHO_N "checking for ISO C99 support to TR1 in ... $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 + #include + #include +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 functions. + echo "$as_me:$LINENO: checking for ISO C99 support to TR1 in " >&5 +echo $ECHO_N "checking for ISO C99 support to TR1 in ... $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 +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' diff --git a/libstdc++-v3/docs/html/ext/tr1.html b/libstdc++-v3/docs/html/ext/tr1.html index 609656cdde7e..467226076766 100644 --- a/libstdc++-v3/docs/html/ext/tr1.html +++ b/libstdc++-v3/docs/html/ext/tr1.html @@ -2187,73 +2187,73 @@ release. 8.30 Additions to header <cwchar> + done - missing 8.30.1 Synopsis + done - missing 8.30.2 Definitions + done - missing 8.30.3 Additional wide format specifiers + done - missing 8.31 Additions to header <wchar.h> + done - missing 8.32 Additions to header <cwctype> + done - missing 8.32.1 Synopsis + done - missing 8.32.2 Function iswblank + done - missing 8.33 Additions to header <wctype.h> + done - missing @@ -2307,7 +2307,7 @@ permitted in any medium, provided this notice is preserved.
- Last modified 2006-02-02 + Last modified 2006-02-03 diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 5fcab8f41bf5..4e06400b286a 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -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. diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 1568c57616ea..a50108c801c7 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -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 index 000000000000..608022a5c077 --- /dev/null +++ b/libstdc++-v3/include/tr1/cwchar @@ -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 + +#if _GLIBCXX_USE_WCHAR_T + +#include + +#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 index 000000000000..3e94f270213a --- /dev/null +++ b/libstdc++-v3/include/tr1/cwctype @@ -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 + +#if _GLIBCXX_USE_WCHAR_T + +#include + +#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 index 000000000000..295b6a966a6a --- /dev/null +++ b/libstdc++-v3/include/tr1/wchar.h @@ -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 + +#endif diff --git a/libstdc++-v3/include/tr1/wctype.h b/libstdc++-v3/include/tr1/wctype.h new file mode 100644 index 000000000000..083410949477 --- /dev/null +++ b/libstdc++-v3/include/tr1/wctype.h @@ -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 + +#endif diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc index 57d81f1ffc9f..35c34f412d5f 100644 --- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc @@ -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 index 000000000000..577868a1504e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwchar/functions.cc @@ -0,0 +1,63 @@ +// { dg-do compile } + +// 2006-02-03 Paolo Carlini +// +// 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 + +#include +#include +#include + +#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 index 000000000000..5dc5a84b4d00 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cwctype/functions.cc @@ -0,0 +1,40 @@ +// { dg-do compile } + +// 2006-02-03 Paolo Carlini +// +// 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 + +#include + +#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 diff --git a/libstdc++-v3/testsuite/tr1/headers.cc b/libstdc++-v3/testsuite/tr1/headers.cc index 510b29d48c0c..4b070036e0b2 100644 --- a/libstdc++-v3/testsuite/tr1/headers.cc +++ b/libstdc++-v3/testsuite/tr1/headers.cc @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include #include @@ -44,3 +46,5 @@ #include #include #include +#include +#include -- 2.39.2