diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-01 00:52:26 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-01 00:52:26 +0000 |
commit | a31c6285d1d91b9aed62161e9f5b4f5e62385df3 (patch) | |
tree | e7ee0a6b808d5ca7fa926c97968c326f2c589bc7 /libstdc++-v3/shadow | |
parent | 032297ce19c2ee30e957f988cb624fef033e80ac (diff) | |
download | gcc-a31c6285d1d91b9aed62161e9f5b4f5e62385df3.tar.gz |
2000-05-31 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Add strtoull checks...
2000-05-31 Steven King <sxking@uswest.net>
* shadow/time.h: fix typo
* shadow/wchar.h: ifdef __USE_GNU for wcsdup
* shadow/bits/std_cwchar.h: ditto
* shadow/bits/std_cstdlib.h: add overloads of abs and div for long
and long long.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34321 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/shadow')
-rw-r--r-- | libstdc++-v3/shadow/bits/std_cstdlib.h | 59 | ||||
-rw-r--r-- | libstdc++-v3/shadow/bits/std_cwchar.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/shadow/time.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/shadow/wchar.h | 2 |
4 files changed, 46 insertions, 19 deletions
diff --git a/libstdc++-v3/shadow/bits/std_cstdlib.h b/libstdc++-v3/shadow/bits/std_cstdlib.h index 26c9a870638..438d4456125 100644 --- a/libstdc++-v3/shadow/bits/std_cstdlib.h +++ b/libstdc++-v3/shadow/bits/std_cstdlib.h @@ -1,6 +1,6 @@ // -*- C++ -*- header wrapper -// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// Copyright (C) 1997-1999, 2000 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 @@ -40,25 +40,25 @@ # include <bits/std_cstddef.h> /* pick up NULL, size_t */ - namespace _C_legacy { - extern "C" { +namespace _C_legacy { + extern "C" { # define _IN_C_LEGACY_ # pragma system_header # include_next <stdlib.h> typedef int (*_C_cmp_fun_ptr)(const void*, const void*); // C fn ptr } - const int _CPP_EXIT_SUCCESS_capture = int(EXIT_SUCCESS); - const int _CPP_EXIT_FAILURE_capture = int(EXIT_FAILURE); - const int _CPP_RAND_MAX_capture = int(RAND_MAX); - inline int _CPP_MB_CUR_MAX_capture() { return int(MB_CUR_MAX); } - // typedef size_t _CPP_size_t_capture; - // typedef wchar_t _CPP_wchar_t_capture; - typedef div_t _CPP_div_t_capture; - typedef ldiv_t _CPP_ldiv_t_capture; - - namespace _C_shadow { - } - } // close namespace ::_C_legacy:: + const int _CPP_EXIT_SUCCESS_capture = int(EXIT_SUCCESS); + const int _CPP_EXIT_FAILURE_capture = int(EXIT_FAILURE); + const int _CPP_RAND_MAX_capture = int(RAND_MAX); + inline int _CPP_MB_CUR_MAX_capture() { return int(MB_CUR_MAX); } + // typedef size_t _CPP_size_t_capture; + // typedef wchar_t _CPP_wchar_t_capture; + typedef div_t _CPP_div_t_capture; + typedef ldiv_t _CPP_ldiv_t_capture; + + namespace _C_shadow { + } +} // namespace _C_legacy:: # undef size_t # undef wchar_t @@ -100,6 +100,10 @@ # undef div # undef labs # undef ldiv +#ifdef _GLIBCPP_USE_LONG_LONG +# undef llabs +# undef lldiv +#endif # undef mblen # undef mbtowc # undef wctomb @@ -185,11 +189,25 @@ inline int abs(int __x) { return __x >= 0 ? __x : -__x; } inline div_t div(int __n, int __d) - { _div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + { div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } inline long labs(long __x) { return __x >= 0 ? __x : -__x; } - inline ldiv_t ldiv(long __num, long __den) - { _ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline long abs(long __x) + { return __x >= 0 ? __x : -__x; } + inline ldiv_t ldiv(long __n, long __d) + { ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline ldiv_t div(long __n, long __d) + { ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } +#ifdef _GLIBCPP_USE_LONG_LONG + inline long long llabs(long long __x) + { return __x >= 0 ? __x : -__x; } + inline long long abs(long long __x) + { return __x >= 0 ? __x : -__x; } + inline lldiv_t lldiv(long long __n, long long __d) + { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } + inline lldiv_t div(long long __n, long long __d) + { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } +#endif using ::_C_legacy::mblen; using ::_C_legacy::mbtowc;; @@ -213,6 +231,10 @@ using ::std::div; using ::std::labs; using ::std::ldiv; +#ifdef _GLIBCPP_USE_LONG_LONG + using ::std::llabs; + using ::std::lldiv; +#endif } } @@ -220,3 +242,4 @@ #endif + diff --git a/libstdc++-v3/shadow/bits/std_cwchar.h b/libstdc++-v3/shadow/bits/std_cwchar.h index bd5c74c9089..d4700ecf003 100644 --- a/libstdc++-v3/shadow/bits/std_cwchar.h +++ b/libstdc++-v3/shadow/bits/std_cwchar.h @@ -213,7 +213,9 @@ using ::_C_legacy::wcstok; using ::_C_legacy::wcslen; #ifndef __sun +#ifdef __USE_GNU using ::_C_legacy::wcsdup; +#endif using ::_C_legacy::wcsstr; using ::_C_legacy::wmemchr; using ::_C_legacy::wmemcmp; diff --git a/libstdc++-v3/shadow/time.h b/libstdc++-v3/shadow/time.h index 2ace7c93ed9..db241651d9c 100644 --- a/libstdc++-v3/shadow/time.h +++ b/libstdc++-v3/shadow/time.h @@ -33,7 +33,7 @@ // turn off glibc-2.0 weirdness. Other systems define similar foolishness #undef __need_time_t #undef __need_clock_t -#undef __need_timespec)) +#undef __need_timespec # undef _SHADOW_NAME # define _SHADOW_NAME <ctime> diff --git a/libstdc++-v3/shadow/wchar.h b/libstdc++-v3/shadow/wchar.h index 7686cdbe11e..7dff1c52f2c 100644 --- a/libstdc++-v3/shadow/wchar.h +++ b/libstdc++-v3/shadow/wchar.h @@ -66,7 +66,9 @@ using ::std::wcscmp; using ::std::wcscoll; using ::std::wcsxfrm; +# ifdef __USE_GNU using ::std::wcsdup; +# endif using ::std::wcschr; using ::std::wcscspn; using ::std::wcspbrk; |