Some shadow fixes.
Steven King
sxking@uswest.net
Thu May 25 17:00:00 GMT 2000
A revised patch that I believe has those changes that no one disagreed with,
in addition, I added abs/llabs/lldiv/div support for long long that I hope no
one will disagree with.
2000-05-25 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.
Index: shadow/time.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/shadow/time.h,v
retrieving revision 1.2
diff -r1.2 time.h
36c36
< #undef __need_timespec))
---
> #undef __need_timespec
Index: shadow/wchar.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/shadow/wchar.h,v
retrieving revision 1.2
diff -r1.2 wchar.h
68a69
> # ifdef __USE_GNU
69a71
> # endif
Index: shadow/bits/std_cstdlib.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/shadow/bits/std_cstdlib.h,v
retrieving revision 1.3
diff -r1.3 std_cstdlib.h
58c58,62
<
---
> #ifdef _GLIBCPP_USE_LONG_LONG
> # ifdef __USE_ISOC9X
> typedef lldiv_t _CPP_lldiv_t_capture;
> # endif
> #endif
127c131,142
<
---
> #ifdef _GLIBCPP_USE_LONG_LONG
> # ifdef __USE_ISOC9X
> typedef ::_C_legacy::_CPP_ldiv_t_capture _CPP_ldiv_t;
> struct ldiv_t : _CPP_ldiv_t {};
> # else
> struct lldiv_t
> {
> long long int quot;
> long long int rem;
> };
> # endif
> #endif
172c187
< size_t __size, int (*__cmp)(const void*, const void*))
---
> size_t __size, int (*__cmp)(const void*, const void*))
180c195
< int (*__cmp)(const void*, const void*))
---
> int (*__cmp)(const void*, const void*))
188c203
< { _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; }
191,192c206,221
< 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
Index: shadow/bits/std_cwchar.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/shadow/bits/std_cwchar.h,v
retrieving revision 1.3
diff -r1.3 std_cwchar.h
215a216
> #ifdef __USE_GNU
216a218
> #endif
--
Steven King
sxking@uswest.net
More information about the Libstdc++
mailing list