From 20921e5333ab7f3e2c233c20cf23bed943bf88ab Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 26 Jan 2006 11:29:20 +0000 Subject: [PATCH] cfenv: New. 2006-01-26 Paolo Carlini * include/tr1/cfenv: New. * include/Makefile.am: Add. * testsuite/tr1/8_c_compatibility/cfenv/functions.cc: New. * testsuite/tr1/8_c_compatibility/cfenv/types.cc: Likewise. * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add checks. * docs/html/ext/tr1.html: Update; add note. * include/Makefile.in: Regenerate. * config.h.in: Likewise. * configure: Likewise. * testsuite/tr1/8_c_compatibility/complex/functions.cc: Tweak. * testsuite/tr1/8_c_compatibility/cctype/functions.cc: Likewise. * docs/html/faq/index.html: Fix link to tr1.html text; fix formatting. From-SVN: r110252 --- libstdc++-v3/ChangeLog | 18 ++ libstdc++-v3/acinclude.m4 | 32 ++- libstdc++-v3/config.h.in | 7 + libstdc++-v3/configure | 230 ++++++++++++++++++++- libstdc++-v3/docs/html/ext/tr1.html | 24 ++- libstdc++-v3/docs/html/faq/index.html | 57 ++--- libstdc++-v3/include/Makefile.am | 1 + libstdc++-v3/include/Makefile.in | 1 + libstdc++-v3/include/tr1/cfenv | 86 ++++++++ .../tr1/8_c_compatibility/cctype/functions.cc | 17 +- .../tr1/8_c_compatibility/cfenv/functions.cc | 52 +++++ .../testsuite/tr1/8_c_compatibility/cfenv/types.cc | 36 ++++ .../tr1/8_c_compatibility/complex/functions.cc | 23 +-- 13 files changed, 526 insertions(+), 58 deletions(-) create mode 100644 libstdc++-v3/include/tr1/cfenv create mode 100644 libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc create mode 100644 libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a8cd4c1..3c38e85 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,21 @@ +2006-01-26 Paolo Carlini + + * include/tr1/cfenv: New. + * include/Makefile.am: Add. + * testsuite/tr1/8_c_compatibility/cfenv/functions.cc: New. + * testsuite/tr1/8_c_compatibility/cfenv/types.cc: Likewise. + * acinclude.m4 ([GLIBCXX_CHECK_C99_TR1]): Add checks. + * docs/html/ext/tr1.html: Update; add note. + * include/Makefile.in: Regenerate. + * config.h.in: Likewise. + * configure: Likewise. + + * testsuite/tr1/8_c_compatibility/complex/functions.cc: Tweak. + * testsuite/tr1/8_c_compatibility/cctype/functions.cc: Likewise. + + * docs/html/faq/index.html: Fix link to tr1.html text; fix + formatting. + 2006-01-25 Paolo Carlini * include/tr1/cctype: New. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 4e2b169..981fc92 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1098,7 +1098,8 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) AC_CACHE_VAL(ac_c99_ctype_tr1, [ AC_TRY_COMPILE([#include ], - [isblank(0); + [int ch; + isblank(ch); ],[ac_c99_ctype_tr1=yes], [ac_c99_ctype_tr1=no]) ]) AC_MSG_RESULT($ac_c99_ctype_tr1) @@ -1108,6 +1109,35 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [ in namespace std::tr1.]) fi + # Check for the existence of functions. + AC_CHECK_HEADERS(fenv.h, ac_has_fenv_h=yes, ac_has_fenv_h=no) + ac_c99_fenv_tr1=no; + if test x"$ac_has_fenv_h" = x"yes"; then + AC_MSG_CHECKING([for ISO C99 support to TR1 in ]) + AC_TRY_COMPILE([#include ], + [int except, mode; + fexcept_t* pflag; + fenv_t* penv; + feclearexcept(except); + fegetexceptflag(pflag, except); + feraiseexcept(except); + fesetexceptflag(pflag, except); + fetestexcept(except); + fegetround(); + fesetround(mode); + fegetenv(penv); + feholdexcept(penv); + fesetenv(penv); + feupdateenv(penv); + ],[ac_c99_fenv_tr1=yes], [ac_c99_fenv_tr1=no]) + fi + AC_MSG_RESULT($ac_c99_fenv_tr1) + if test x"$ac_c99_fenv_tr1" = x"yes"; then + AC_DEFINE(_GLIBCXX_USE_C99_FENV_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 f8877ac..2184c2d 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -69,6 +69,9 @@ /* Define to 1 if you have the `fabsl' function. */ #undef HAVE_FABSL +/* Define to 1 if you have the header file. */ +#undef HAVE_FENV_H + /* Define to 1 if you have the `finite' function. */ #undef HAVE_FINITE @@ -700,6 +703,10 @@ namespace std::tr1. */ #undef _GLIBCXX_USE_C99_CTYPE_TR1 +/* Define if C99 functions in should be imported in in + namespace std::tr1. */ +#undef _GLIBCXX_USE_C99_FENV_TR1 + /* Define if C99 functions or macros in should be imported in in namespace std. */ #undef _GLIBCXX_USE_C99_MATH diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 9c3599c..6cb8dd7 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -30238,7 +30238,8 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -isblank(0); +int ch; + isblank(ch); ; return 0; @@ -30287,6 +30288,233 @@ _ACEOF fi + # Check for the existence of functions. + +for ac_header in fenv.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_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_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------------------- ## +## Report this to the package-unused lists. ## +## ----------------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + ac_has_fenv_h=yes +else + ac_has_fenv_h=no +fi + +done + + ac_c99_fenv_tr1=no; + if test x"$ac_has_fenv_h" = x"yes"; then + 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 + 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 () +{ +int except, mode; + fexcept_t* pflag; + fenv_t* penv; + feclearexcept(except); + fegetexceptflag(pflag, except); + feraiseexcept(except); + fesetexceptflag(pflag, except); + fetestexcept(except); + fegetround(); + fesetround(mode); + fegetenv(penv); + feholdexcept(penv); + fesetenv(penv); + feupdateenv(penv); + + ; + 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_fenv_tr1=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_c99_fenv_tr1=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_c99_fenv_tr1" >&5 +echo "${ECHO_T}$ac_c99_fenv_tr1" >&6 + if test x"$ac_c99_fenv_tr1" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define _GLIBCXX_USE_C99_FENV_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 de432f4..0eeb892 100644 --- a/libstdc++-v3/docs/html/ext/tr1.html +++ b/libstdc++-v3/docs/html/ext/tr1.html @@ -30,7 +30,14 @@ Draft Technical Report on C++ Library Extensions

-This page describes the TR1 support in mainline GCC CVS, not in any particular release. +In this implementation the header names are prefixed by +tr1/, for instance <tr1/functional>, +<tr1/memory>, and so on. +

+ +

+This page describes the TR1 support in mainline GCC CVS, not in any particular +release.

@@ -1796,25 +1803,25 @@ This page describes the TR1 support in mainline GCC CVS, not in any particular r + - + - + - @@ -1828,25 +1835,25 @@ This page describes the TR1 support in mainline GCC CVS, not in any particular r + - + - + - @@ -2259,7 +2266,8 @@ This page describes the TR1 support in mainline GCC CVS, not in any particular r
  • The shared_ptr implementation uses some code from the - Boost shared_ptr library. + Boost + shared_ptr library.
  • diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html index e5290a3..4d0f922 100644 --- a/libstdc++-v3/docs/html/faq/index.html +++ b/libstdc++-v3/docs/html/faq/index.html @@ -982,64 +982,73 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff

    5.5 Does libstdc++ support TR1?

    -

    The C++ Standard Library Technical Report adds many new features to the library. - The latest version of this effort is described in - +

    The C++ Standard Library Technical Report adds many new features to + the library. The latest version of this effort is described in + Technical Report 1.

    libstdc++ strives to implement all of TR1. - The libstdc++ implementation status of the TR1 draft is listed in - this page. + An overview of the implementation status + is available.

    Briefly, the features of TR1 and the current status are:

    Unordered containers - Complete - - The unordered_set, unordered_map, unordered_multiset, and unordered_multimap containers - are hashed versions of the map, set, multimap, and multiset containers respectively. - These classes are suitable replacements for the SGI STL hash_map and hash_set extensions. + The unordered_set, unordered_map, unordered_multiset, and + unordered_multimap containers are hashed versions of the map, set, + multimap, and multiset containers respectively. These classes are + suitable replacements for the SGI STL hash_map and hash_set + extensions.

    Reference-counted smart pointers - Complete - - The shared_ptr and weak_ptr allow several object to know about a pointer and whether it is valid. - When the last reference to the pointer is destroyed the pointer is freed. + The shared_ptr and weak_ptr allow several object to know about a + pointer and whether it is valid. When the last reference to the + pointer is destroyed the pointer is freed.

    Type traits - Complete - - The type_traits class gives templates the ability to probe information about the input type - and enable type-dependent logic to be performed without the need of template specializations. + The type_traits class gives templates the ability to probe + information about the input type and enable type-dependent logic + to be performed without the need of template specializations.

    Fixed-size arrays - Complete - - The array class implements small fixed-sized arrays with container semantics. + The array class implements small fixed-sized arrays with container + semantics.

    Tuples - Complete - - The tuple class implements small heterogeneous arrays. This is an enhanced pair. - In fact, the standard pair is enhanced with a tuple interface. + The tuple class implements small heterogeneous arrays. This is an + enhanced pair. In fact, the standard pair is enhanced with a tuple + interface.

    A regular expression engine - This library provides for regular expression objects with traversal of - text with return of subexpressions. + This library provides for regular expression objects with traversal + of text with return of subexpressions.

    A random number engine - This library contains randow number generators with several different choices - of distribution. + This library contains randow number generators with several different + choices of distribution.

    Special functions - Under construction - - Twenty-three mathematical functions familiar to physicists and engineers are included: - cylindrical and spherical Bessel and Neumann functions, hypergeometric functions, - Laguerre polynomials, Legendre functions, elliptic integrals, exponential integrals - and the Riemann zeta function all for your computing pleasure. + Twenty-three mathematical functions familiar to physicists and + engineers are included: cylindrical and spherical Bessel and Neumann + functions, hypergeometric functions, Laguerre polynomials, Legendre + functions, elliptic integrals, exponential integrals and the Riemann + zeta function all for your computing pleasure.

    C99 compatibility - Under construction - - There are many features designed to minimize the divergence of the C and the C++ languages. + There are many features designed to minimize the divergence of the C + and the C++ languages.


    diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index dc66cbb..2766df6 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -485,6 +485,7 @@ tr1_headers = \ ${tr1_srcdir}/bind_iterate.h \ ${tr1_srcdir}/boost_shared_ptr.h \ ${tr1_srcdir}/cctype \ + ${tr1_srcdir}/cfenv \ ${tr1_srcdir}/common.h \ ${tr1_srcdir}/complex \ ${tr1_srcdir}/functional \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 4266351..b76fec7 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -702,6 +702,7 @@ tr1_headers = \ ${tr1_srcdir}/bind_iterate.h \ ${tr1_srcdir}/boost_shared_ptr.h \ ${tr1_srcdir}/cctype \ + ${tr1_srcdir}/cfenv \ ${tr1_srcdir}/common.h \ ${tr1_srcdir}/complex \ ${tr1_srcdir}/functional \ diff --git a/libstdc++-v3/include/tr1/cfenv b/libstdc++-v3/include/tr1/cfenv new file mode 100644 index 0000000..d4e925a --- /dev/null +++ b/libstdc++-v3/include/tr1/cfenv @@ -0,0 +1,86 @@ +// TR1 cctype -*- 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_CFENV +#define _TR1_CFENV 1 + +#include + +#if _GLIBCXX_HAVE_FENV_H +#include +#endif + +#if _GLIBCXX_USE_C99_FENV_TR1 + +#undef feclearexcept +#undef fegetexceptflag +#undef feraiseexcept +#undef fesetexceptflag +#undef fetestexcept +#undef fegetround +#undef fesetround +#undef fegetenv +#undef feholdexcept +#undef fesetenv +#undef feupdateenv + +// namespace std::tr1 +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(tr1) + + // types + using ::fenv_t; + using ::fexcept_t; + + // functions + using ::feclearexcept; + using ::fegetexceptflag; + using ::feraiseexcept; + using ::fesetexceptflag; + using ::fetestexcept; + + using ::fegetround; + using ::fesetround; + + using ::fegetenv; + using ::feholdexcept; + using ::fesetenv; + using ::feupdateenv; + +_GLIBCXX_END_NAMESPACE +} + +#endif + +#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 9665a60..57d81f1 100644 --- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cctype/functions.cc @@ -1,3 +1,5 @@ +// { dg-do compile } + // 2006-01-25 Paolo Carlini // // Copyright (C) 2006 Free Software Foundation, Inc. @@ -22,17 +24,12 @@ #include -void test01(int r = 0) +void test01() { #if _GLIBCXX_USE_C99_CTYPE_TR1 - r = std::tr1::isblank(0); -#else - r = 0; -#endif -} -int main() -{ - test01(); - return 0; + int ch = 0, r; + r = std::tr1::isblank(ch); + +#endif } diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc new file mode 100644 index 0000000..9f3769f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/functions.cc @@ -0,0 +1,52 @@ +// { dg-do compile } + +// 2006-01-26 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 Header + +#include + +void test01() +{ +#if _GLIBCXX_USE_C99_FENV_TR1 + + int except = 0, mode = 0; + std::tr1::fexcept_t* pflag = 0; + std::tr1::fenv_t* penv = 0; + + int r; + + r = std::tr1::feclearexcept(except); + r = std::tr1::fegetexceptflag(pflag, except); + r = std::tr1::feraiseexcept(except); + r = std::tr1::fesetexceptflag(pflag, except); + r = std::tr1::fetestexcept(except); + + r = std::tr1::fegetround(); + r = std::tr1::fesetround(mode); + + r = std::tr1::fegetenv(penv); + r = std::tr1::feholdexcept(penv); + r = std::tr1::fesetenv(penv); + r = std::tr1::feupdateenv(penv); + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc new file mode 100644 index 0000000..66186cd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cfenv/types.cc @@ -0,0 +1,36 @@ +// { dg-do compile } + +// 2006-01-26 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 Header + +#include + +void test01() +{ +#if _GLIBCXX_USE_C99_FENV_TR1 + + // Check for required typedefs + typedef std::tr1::fenv_t fenv_t_type; + typedef std::tr1::fexcept_t fexcept_t_type; + +#endif +} diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc index 1fdd108..c4749e9 100644 --- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc +++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/functions.cc @@ -1,3 +1,5 @@ +// { dg-do compile } + // 2006-01-10 Paolo Carlini // // Copyright (C) 2006 Free Software Foundation, Inc. @@ -25,19 +27,18 @@ template void test01_do() { - using namespace std::tr1; typedef std::complex cmplx_type; cmplx_type ans; - ans = acos(cmplx_type(1.0, 1.0)); - ans = asin(cmplx_type(1.0, 1.0)); - ans = atan(cmplx_type(1.0, 1.0)); + ans = std::tr1::acos(cmplx_type(1.0, 1.0)); + ans = std::tr1::asin(cmplx_type(1.0, 1.0)); + ans = std::tr1::atan(cmplx_type(1.0, 1.0)); - ans = acosh(cmplx_type(1.0, 1.0)); - ans = asinh(cmplx_type(1.0, 1.0)); - ans = atanh(cmplx_type(1.0, 1.0)); - ans = fabs(cmplx_type(1.0, 1.0)); + ans = std::tr1::acosh(cmplx_type(1.0, 1.0)); + ans = std::tr1::asinh(cmplx_type(1.0, 1.0)); + ans = std::tr1::atanh(cmplx_type(1.0, 1.0)); + ans = std::tr1::fabs(cmplx_type(1.0, 1.0)); } void test01() @@ -46,9 +47,3 @@ void test01() test01_do(); test01_do(); } - -int main() -{ - test01(); - return 0; -} -- 2.7.4
    8.4 Additions to header <cctype>done missing
    8.4.1 Synopsisdone missing
    8.4.2 Function isblankdone missing
    8.6 Header <cfenv>done missing
    8.6.1 Synopsisdone missing
    8.6.2 Definitionsdone missing