From acd1cc4b295ac00fffe0d727291b6fdf58f3392d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 26 Apr 2013 11:32:49 +0000 Subject: cstdio (gets): Provide only in C++98 and C++11. 2013-04-26 Paolo Carlini * include/c_global/cstdio (gets): Provide only in C++98 and C++11. * include/c_std/cstdio (gets): Likewise. * testsuite/27_io/headers/cstdio/functions_std.cc: Adjust. From-SVN: r198335 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/c_global/cstdio | 6 +++++- libstdc++-v3/include/c_std/cstdio | 6 +++++- libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc | 6 ++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 58460196d92..983ff967cb7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2013-04-26 Paolo Carlini + + * include/c_global/cstdio (gets): Provide only in C++98 and C++11. + * include/c_std/cstdio (gets): Likewise. + * testsuite/27_io/headers/cstdio/functions_std.cc: Adjust. + 2013-04-25 Paolo Carlini PR libstdc++/57065 diff --git a/libstdc++-v3/include/c_global/cstdio b/libstdc++-v3/include/c_global/cstdio index fcbec0cf5b9..249a77968be 100644 --- a/libstdc++-v3/include/c_global/cstdio +++ b/libstdc++-v3/include/c_global/cstdio @@ -69,7 +69,9 @@ extern "C" char* gets (char* __s) __attribute__((deprecated)); #undef ftell #undef fwrite #undef getc -#undef gets +#if __cplusplus <= 201103L +# undef gets +#endif #undef perror #undef printf #undef putc @@ -116,7 +118,9 @@ namespace std using ::fwrite; using ::getc; using ::getchar; +#if __cplusplus <= 201103L using ::gets; +#endif using ::perror; using ::printf; using ::putc; diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio index e85bd834af2..273383e6999 100644 --- a/libstdc++-v3/include/c_std/cstdio +++ b/libstdc++-v3/include/c_std/cstdio @@ -70,7 +70,9 @@ extern "C" char* gets (char* __s) __attribute__((deprecated)); #undef fwrite #undef getc #undef getchar -#undef gets +#if __cplusplus <= 201103L +# undef gets +#endif #undef perror #undef printf #undef putc @@ -117,7 +119,9 @@ namespace std using ::fwrite; using ::getc; using ::getchar; +#if __cplusplus <= 201103L using ::gets; +#endif using ::perror; using ::printf; using ::putc; diff --git a/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc index 19a80b73e30..c5d787fc887 100644 --- a/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc +++ b/libstdc++-v3/testsuite/27_io/headers/cstdio/functions_std.cc @@ -24,8 +24,10 @@ namespace gnu using std::clearerr; using std::tmpfile; using std::fgets; - using std::fscanf; - using std::gets; + using std::fscanf; +#if __cplusplus <= 201103L + using std::gets; +#endif using std::rename; using std::fclose; using std::fopen; -- cgit v1.2.1