diff options
| author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-18 08:08:07 +0000 |
|---|---|---|
| committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-18 08:08:07 +0000 |
| commit | 5b8b451749fb4fa7d1c7afe08c6565f1d86a57a7 (patch) | |
| tree | 0efdb35c85d4cd38b0a777753a8c02442040322d /libstdc++-v3/include/c_std | |
| parent | b5860aba6737f2843656672bbb7caf2baee2c496 (diff) | |
| download | ppe42-gcc-5b8b451749fb4fa7d1c7afe08c6565f1d86a57a7.tar.gz ppe42-gcc-5b8b451749fb4fa7d1c7afe08c6565f1d86a57a7.zip | |
2005-12-17 Benjamin Kosnik <bkoz@redhat.com>
* src/io-inst.cc: Separate instantiations into...
* src/ios-inst.cc: .. this.
* src/iostream-inst.cc: ... and this.
* src/Makefile.am (sources): Update.
* src/Makefile.in: Regenerate.
2005-12-17 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/25472
* include/c_std/std_cstdlib.h: Fix for freestanding.
2005-12-17 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/libstdc++-dg/normal.exp: Rename to..
* testsuite/libstdc++-dg/conformance.exp: ... this.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/c_std')
| -rw-r--r-- | libstdc++-v3/include/c_std/std_cstdlib.h | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/libstdc++-v3/include/c_std/std_cstdlib.h b/libstdc++-v3/include/c_std/std_cstdlib.h index b5c47fa2d44..2139092f57d 100644 --- a/libstdc++-v3/include/c_std/std_cstdlib.h +++ b/libstdc++-v3/include/c_std/std_cstdlib.h @@ -50,13 +50,25 @@ #include <bits/c++config.h> #include <cstddef> -#if _GLIBCXX_HOSTED -/* The C standard does not require a freestanding implementation to - provide <stdlib.h>. However, the C++ standard does still require - <cstdlib> -- but only the functionality mentioned in - [lib.support.start.term]. */ +#if !_GLIBCXX_HOSTED +// The C standard does not require a freestanding implementation to +// provide <stdlib.h>. However, the C++ standard does still require +// <cstdlib> -- but only the functionality mentioned in +// [lib.support.start.term]. + +#define EXIT_SUCCESS 0 +#define EXIT_FAILURE 1 + +namespace std +{ + extern "C" void abort(void); + extern "C" int atexit(void (*)()); + extern "C" void exit(int); +} // namespace std + +#else + #include <stdlib.h> -#endif // Get rid of those macros defined in <stdlib.h> in lieu of real functions. #undef abort @@ -90,7 +102,6 @@ namespace std { -#if _GLIBCXX_HOSTED using ::div_t; using ::ldiv_t; @@ -132,16 +143,7 @@ namespace std inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } -#else - /* Provide the minimal set of definitions required of a freestanding - implementation. */ - #define EXIT_SUCCESS 0 - #define EXIT_FAILURE 1 - extern "C" void abort(void); - extern "C" int atexit(void (*)()); - extern "C" void exit(int); -#endif -} +} // namespace std #if _GLIBCXX_USE_C99 @@ -198,21 +200,24 @@ namespace __gnu_cxx namespace std { #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::lldiv_t; + using ::__gnu_cxx::lldiv_t; #endif - using __gnu_cxx::_Exit; - using __gnu_cxx::abs; + using ::__gnu_cxx::_Exit; + using ::__gnu_cxx::abs; #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC - using __gnu_cxx::llabs; - using __gnu_cxx::div; - using __gnu_cxx::lldiv; + using ::__gnu_cxx::llabs; + using ::__gnu_cxx::div; + using ::__gnu_cxx::lldiv; #endif - using __gnu_cxx::atoll; - using __gnu_cxx::strtof; - using __gnu_cxx::strtoll; - using __gnu_cxx::strtoull; - using __gnu_cxx::strtold; + using ::__gnu_cxx::atoll; + using ::__gnu_cxx::strtof; + using ::__gnu_cxx::strtoll; + using ::__gnu_cxx::strtoull; + using ::__gnu_cxx::strtold; } -#endif + +#endif // _GLIBCXX_USE_C99 + +#endif // !_GLIBCXX_HOSTED #endif |

