Commit 554241c3 by Ulrich Drepper Committed by Jeff Law

Bring over lost changes from Cygnus's directory.

	* Missing ChangeLog entries.
	* Whitespace fixes.
	* Enable multilib by default
	* One stl fix (#ifdef -> #if)

From-SVN: r26234
parent 5e62dee5
...@@ -33,6 +33,20 @@ Thu Feb 18 19:53:17 1999 Marc Espie <espie@cvs.openbsd.org> ...@@ -33,6 +33,20 @@ Thu Feb 18 19:53:17 1999 Marc Espie <espie@cvs.openbsd.org>
* config/openbsd.ml: New file. * config/openbsd.ml: New file.
* config/openbsd.mt: New file. * config/openbsd.mt: New file.
1999-02-04 Ulrich Drepper <drepper@cygnus.com>
* configure.in: Recognize --enable-threads=posix for all
platforms.
* config/posix.mt: New file.
* configure.in: Add fragments for Solaris defining macro specifying
thread library to be used.
* config/sol2pth.mt: New file
* config/sol2solth.mt: New file.
* stl/stl_alloc.h: Add support for Solaris thread library.
* stl/stl_config.h: Recognize _SOLTHREADS and define internal macros
appropriately.
1999-01-28 Baron Roberts <baron@sgi.com> 1999-01-28 Baron Roberts <baron@sgi.com>
* string: Uncomment wstring declaration. * string: Uncomment wstring declaration.
......
...@@ -176,6 +176,11 @@ if [ -n "${with_cross_host}" ] ; then ...@@ -176,6 +176,11 @@ if [ -n "${with_cross_host}" ] ; then
mv -f Makefile.tem Makefile mv -f Makefile.tem Makefile
fi fi
# enable multilib-ing by default.
if [ -z "${enable_multilib}" ]; then
enable_multilib=yes
fi
. ${topsrcdir}/config-ml.in . ${topsrcdir}/config-ml.in
gxx_include_dir= gxx_include_dir=
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* in supporting documentation. Silicon Graphics makes no * in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any * representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty. * purpose. It is provided "as is" without express or implied warranty.
*/ */
#ifndef __SGI_STL_BITSET #ifndef __SGI_STL_BITSET
#define __SGI_STL_BITSET #define __SGI_STL_BITSET
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
// THIS FEATURE*. It is experimental, and it may be removed in // THIS FEATURE*. It is experimental, and it may be removed in
// future releases. // future releases.
// A bitset of size N, using words of type _WordT, will have // A bitset of size N, using words of type _WordT, will have
// N % (sizeof(_WordT) * CHAR_BIT) unused bits. (They are the high- // N % (sizeof(_WordT) * CHAR_BIT) unused bits. (They are the high-
// order bits in the highest word.) It is a class invariant // order bits in the highest word.) It is a class invariant
// of class bitset<> that those unused bits are always zero. // of class bitset<> that those unused bits are always zero.
// Most of the actual code isn't contained in bitset<> itself, but in the // Most of the actual code isn't contained in bitset<> itself, but in the
// base class _Base_bitset. The base class works with whole words, not with // base class _Base_bitset. The base class works with whole words, not with
// individual bits. This allows us to specialize _Base_bitset for the // individual bits. This allows us to specialize _Base_bitset for the
// important special case where the bitset is only a single word. // important special case where the bitset is only a single word.
...@@ -51,14 +51,14 @@ __STL_BEGIN_NAMESPACE ...@@ -51,14 +51,14 @@ __STL_BEGIN_NAMESPACE
#endif #endif
// structure to aid in counting bits // structure to aid in counting bits
template<bool __dummy> template<bool __dummy>
struct _Bit_count { struct _Bit_count {
static unsigned char _S_bit_count[256]; static unsigned char _S_bit_count[256];
}; };
// Mapping from 8 bit unsigned integers to the index of the first one // Mapping from 8 bit unsigned integers to the index of the first one
// bit: // bit:
template<bool __dummy> template<bool __dummy>
struct _First_one { struct _First_one {
static unsigned char _S_first_one[256]; static unsigned char _S_first_one[256];
}; };
...@@ -162,7 +162,7 @@ struct _Base_bitset { ...@@ -162,7 +162,7 @@ struct _Base_bitset {
return __result; return __result;
} }
unsigned long _M_do_to_ulong() const; unsigned long _M_do_to_ulong() const;
// find first "on" bit // find first "on" bit
size_t _M_do_find_first(size_t __not_found) const; size_t _M_do_find_first(size_t __not_found) const;
...@@ -173,7 +173,7 @@ struct _Base_bitset { ...@@ -173,7 +173,7 @@ struct _Base_bitset {
// //
// Definitions of non-inline functions from _Base_bitset. // Definitions of non-inline functions from _Base_bitset.
// //
template<size_t _Nw, class _WordT> template<size_t _Nw, class _WordT>
_Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val) _Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val)
...@@ -187,7 +187,7 @@ _Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val) ...@@ -187,7 +187,7 @@ _Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val)
} }
template<size_t _Nw, class _WordT> template<size_t _Nw, class _WordT>
void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift) void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift)
{ {
if (__shift != 0) { if (__shift != 0) {
const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT); const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
...@@ -195,7 +195,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift) ...@@ -195,7 +195,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift)
const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset; const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset;
size_t __n = _Nw - 1; size_t __n = _Nw - 1;
for ( ; __n > __wshift; --__n) for ( ; __n > __wshift; --__n)
_M_w[__n] = (_M_w[__n - __wshift] << __offset) | _M_w[__n] = (_M_w[__n - __wshift] << __offset) |
(_M_w[__n - __wshift - 1] >> __sub_offset); (_M_w[__n - __wshift - 1] >> __sub_offset);
if (__n == __wshift) if (__n == __wshift)
_M_w[__n] = _M_w[0] << __offset; _M_w[__n] = _M_w[0] << __offset;
...@@ -205,7 +205,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift) ...@@ -205,7 +205,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift)
} }
template<size_t _Nw, class _WordT> template<size_t _Nw, class _WordT>
void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift) void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift)
{ {
if (__shift != 0) { if (__shift != 0) {
const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT); const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
...@@ -214,7 +214,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift) ...@@ -214,7 +214,7 @@ void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift)
const size_t __limit = _Nw - __wshift - 1; const size_t __limit = _Nw - __wshift - 1;
size_t __n = 0; size_t __n = 0;
for ( ; __n < __limit; ++__n) for ( ; __n < __limit; ++__n)
_M_w[__n] = (_M_w[__n + __wshift] >> __offset) | _M_w[__n] = (_M_w[__n + __wshift] >> __offset) |
(_M_w[__n + __wshift + 1] << __sub_offset); (_M_w[__n + __wshift + 1] << __sub_offset);
_M_w[__limit] = _M_w[_Nw-1] >> __offset; _M_w[__limit] = _M_w[_Nw-1] >> __offset;
for (size_t __n1 = __limit + 1; __n1 < _Nw; ++__n1) for (size_t __n1 = __limit + 1; __n1 < _Nw; ++__n1)
...@@ -228,12 +228,12 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const ...@@ -228,12 +228,12 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const
const overflow_error __overflow("bitset"); const overflow_error __overflow("bitset");
if (sizeof(_WordT) >= sizeof(unsigned long)) { if (sizeof(_WordT) >= sizeof(unsigned long)) {
for (size_t __i = 1; __i < _Nw; ++__i) for (size_t __i = 1; __i < _Nw; ++__i)
if (_M_w[__i]) if (_M_w[__i])
__STL_THROW(__overflow); __STL_THROW(__overflow);
const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1)); const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1));
if (_M_w[0] & ~__mask) if (_M_w[0] & ~__mask)
__STL_THROW(__overflow); __STL_THROW(__overflow);
return static_cast<unsigned long>(_M_w[0] & __mask); return static_cast<unsigned long>(_M_w[0] & __mask);
...@@ -244,18 +244,18 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const ...@@ -244,18 +244,18 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const
size_t __min_nwords = __nwords; size_t __min_nwords = __nwords;
if (_Nw > __nwords) { if (_Nw > __nwords) {
for (size_t __i = __nwords; __i < _Nw; ++__i) for (size_t __i = __nwords; __i < _Nw; ++__i)
if (_M_w[__i]) if (_M_w[__i])
__STL_THROW(__overflow); __STL_THROW(__overflow);
} }
else else
__min_nwords = _Nw; __min_nwords = _Nw;
// If unsigned long is 8 bytes and _WordT is 6 bytes, then an unsigned // If unsigned long is 8 bytes and _WordT is 6 bytes, then an unsigned
// long consists of all of one word plus 2 bytes from another word. // long consists of all of one word plus 2 bytes from another word.
const size_t __part = sizeof(unsigned long) % sizeof(_WordT); const size_t __part = sizeof(unsigned long) % sizeof(_WordT);
if (__part != 0 && __nwords <= _Nw && if (__part != 0 && __nwords <= _Nw &&
(_M_w[__min_nwords - 1] >> ((sizeof(_WordT) - __part) * CHAR_BIT)) != 0) (_M_w[__min_nwords - 1] >> ((sizeof(_WordT) - __part) * CHAR_BIT)) != 0)
__STL_THROW(__overflow); __STL_THROW(__overflow);
...@@ -269,7 +269,7 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const ...@@ -269,7 +269,7 @@ unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const
} // End _M_do_to_ulong } // End _M_do_to_ulong
template<size_t _Nw, class _WordT> template<size_t _Nw, class _WordT>
size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const
{ {
for ( size_t __i = 0; __i < _Nw; __i++ ) { for ( size_t __i = 0; __i < _Nw; __i++ ) {
_WordT __thisword = _M_w[__i]; _WordT __thisword = _M_w[__i];
...@@ -292,7 +292,7 @@ size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const ...@@ -292,7 +292,7 @@ size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const
template<size_t _Nw, class _WordT> template<size_t _Nw, class _WordT>
size_t size_t
_Base_bitset<_Nw, _WordT>::_M_do_find_next(size_t __prev, _Base_bitset<_Nw, _WordT>::_M_do_find_next(size_t __prev,
size_t __not_found) const size_t __not_found) const
{ {
// make bound inclusive // make bound inclusive
...@@ -359,7 +359,7 @@ struct _Base_bitset<1, _WordT> { ...@@ -359,7 +359,7 @@ struct _Base_bitset<1, _WordT> {
_Base_bitset( void ) { _M_do_reset(); } _Base_bitset( void ) { _M_do_reset(); }
_Base_bitset(unsigned long __val); _Base_bitset(unsigned long __val);
static size_t _S_whichword( size_t __pos ) { static size_t _S_whichword( size_t __pos ) {
return __pos / __BITS_PER_WORDT(_WordT); return __pos / __BITS_PER_WORDT(_WordT);
...@@ -412,7 +412,7 @@ struct _Base_bitset<1, _WordT> { ...@@ -412,7 +412,7 @@ struct _Base_bitset<1, _WordT> {
return static_cast<unsigned long>(_M_w); return static_cast<unsigned long>(_M_w);
else { else {
const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1)); const _WordT __mask = static_cast<_WordT>(static_cast<unsigned long>(-1));
if (_M_w & ~__mask) if (_M_w & ~__mask)
__STL_THROW(overflow_error("bitset")); __STL_THROW(overflow_error("bitset"));
return static_cast<unsigned long>(_M_w); return static_cast<unsigned long>(_M_w);
} }
...@@ -421,7 +421,7 @@ struct _Base_bitset<1, _WordT> { ...@@ -421,7 +421,7 @@ struct _Base_bitset<1, _WordT> {
size_t _M_do_find_first(size_t __not_found) const; size_t _M_do_find_first(size_t __not_found) const;
// find the next "on" bit that follows "prev" // find the next "on" bit that follows "prev"
size_t _M_do_find_next(size_t __prev, size_t __not_found) const; size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
}; };
...@@ -431,7 +431,7 @@ struct _Base_bitset<1, _WordT> { ...@@ -431,7 +431,7 @@ struct _Base_bitset<1, _WordT> {
// //
template <class _WordT> template <class _WordT>
_Base_bitset<1, _WordT>::_Base_bitset(unsigned long __val) _Base_bitset<1, _WordT>::_Base_bitset(unsigned long __val)
{ {
_M_do_reset(); _M_do_reset();
const size_t __n = min(sizeof(unsigned long)*CHAR_BIT, const size_t __n = min(sizeof(unsigned long)*CHAR_BIT,
...@@ -462,8 +462,8 @@ size_t _Base_bitset<1, _WordT>::_M_do_find_first(size_t __not_found) const ...@@ -462,8 +462,8 @@ size_t _Base_bitset<1, _WordT>::_M_do_find_first(size_t __not_found) const
} }
template <class _WordT> template <class _WordT>
size_t size_t
_Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev, _Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev,
size_t __not_found ) const size_t __not_found ) const
{ {
// make bound inclusive // make bound inclusive
...@@ -499,12 +499,12 @@ _Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev, ...@@ -499,12 +499,12 @@ _Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev,
// //
// One last specialization: _M_do_to_ulong() and the constructor from // One last specialization: _M_do_to_ulong() and the constructor from
// unsigned long are very simple if the bitset consists of a single // unsigned long are very simple if the bitset consists of a single
// word of type unsigned long. // word of type unsigned long.
// //
template<> template<>
inline unsigned long inline unsigned long
_Base_bitset<1, unsigned long>::_M_do_to_ulong() const { return _M_w; } _Base_bitset<1, unsigned long>::_M_do_to_ulong() const { return _M_w; }
template<> template<>
...@@ -531,7 +531,7 @@ template <class _WordT> struct _Sanitize<_WordT, 0> { ...@@ -531,7 +531,7 @@ template <class _WordT> struct _Sanitize<_WordT, 0> {
// Type _WordT may be any unsigned integral type. // Type _WordT may be any unsigned integral type.
template<size_t _Nb, class _WordT = unsigned long> template<size_t _Nb, class _WordT = unsigned long>
class bitset : private _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT> class bitset : private _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>
{ {
private: private:
typedef _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT> _Base; typedef _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT> _Base;
...@@ -620,16 +620,16 @@ public: ...@@ -620,16 +620,16 @@ public:
// 23.3.5.1 constructors: // 23.3.5.1 constructors:
bitset() {} bitset() {}
bitset(unsigned long __val) : bitset(unsigned long __val) :
_Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>(__val) {} _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>(__val) {}
template<class _CharT, class _Traits, class _Alloc> template<class _CharT, class _Traits, class _Alloc>
explicit bitset(const basic_string<_CharT,_Traits,_Alloc>& __s, explicit bitset(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t __pos = 0, size_t __pos = 0,
size_t __n = size_t(basic_string<_CharT,_Traits,_Alloc>::npos)) size_t __n = basic_string<_CharT,_Traits,_Alloc>::npos)
: _Base() : _Base()
{ {
if (__pos > __s.size()) if (__pos > __s.size())
__STL_THROW(out_of_range("bitset")); __STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n); _M_copy_from_string(__s, __pos, __n);
} }
...@@ -742,7 +742,7 @@ public: ...@@ -742,7 +742,7 @@ public:
return _Unchecked_flip(__pos); return _Unchecked_flip(__pos);
} }
bitset<_Nb,_WordT> operator~() const { bitset<_Nb,_WordT> operator~() const {
return bitset<_Nb,_WordT>(*this).flip(); return bitset<_Nb,_WordT>(*this).flip();
} }
...@@ -753,7 +753,7 @@ public: ...@@ -753,7 +753,7 @@ public:
unsigned long to_ulong() const { return _M_do_to_ulong(); } unsigned long to_ulong() const { return _M_do_to_ulong(); }
#ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS #if __STL_EXPLICIT_FUNCTION_TMPL_ARGS
template <class _CharT, class _Traits, class _Alloc> template <class _CharT, class _Traits, class _Alloc>
basic_string<_CharT, _Traits, _Alloc> to_string() const { basic_string<_CharT, _Traits, _Alloc> to_string() const {
basic_string<_CharT, _Traits, _Alloc> __result; basic_string<_CharT, _Traits, _Alloc> __result;
...@@ -802,14 +802,14 @@ public: ...@@ -802,14 +802,14 @@ public:
// EXTENSIONS: bit-find operations. These operations are // EXTENSIONS: bit-find operations. These operations are
// experimental, and are subject to change or removal in future // experimental, and are subject to change or removal in future
// versions. // versions.
// //
// find the index of the first "on" bit // find the index of the first "on" bit
size_t _Find_first() const size_t _Find_first() const
{ return _M_do_find_first(_Nb); } { return _M_do_find_first(_Nb); }
// find the index of the next "on" bit after prev // find the index of the next "on" bit after prev
size_t _Find_next( size_t __prev ) const size_t _Find_next( size_t __prev ) const
{ return _M_do_find_next(__prev, _Nb); } { return _M_do_find_next(__prev, _Nb); }
}; };
...@@ -846,8 +846,8 @@ void bitset<_Nb, _WordT> ...@@ -846,8 +846,8 @@ void bitset<_Nb, _WordT>
::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const ::_M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const
{ {
__s.assign(_Nb, '0'); __s.assign(_Nb, '0');
for (size_t __i = 0; __i < _Nb; ++__i) for (size_t __i = 0; __i < _Nb; ++__i)
if (_Unchecked_test(__i)) if (_Unchecked_test(__i))
__s[_Nb - 1 - __i] = '1'; __s[_Nb - 1 - __i] = '1';
} }
...@@ -894,7 +894,7 @@ operator>>(istream& __is, bitset<_Nb,_WordT>& __x) { ...@@ -894,7 +894,7 @@ operator>>(istream& __is, bitset<_Nb,_WordT>& __x) {
// In new templatized iostreams, use istream::sentry // In new templatized iostreams, use istream::sentry
if (__is.flags() & ios::skipws) { if (__is.flags() & ios::skipws) {
char __c; char __c;
do do
__is.get(__c); __is.get(__c);
while (__is && isspace(__c)); while (__is && isspace(__c));
if (__is) if (__is)
...@@ -915,7 +915,7 @@ operator>>(istream& __is, bitset<_Nb,_WordT>& __x) { ...@@ -915,7 +915,7 @@ operator>>(istream& __is, bitset<_Nb,_WordT>& __x) {
__tmp.push_back(__c); __tmp.push_back(__c);
} }
if (__tmp.empty()) if (__tmp.empty())
__is.clear(__is.rdstate() | ios::failbit); __is.clear(__is.rdstate() | ios::failbit);
else else
__x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
...@@ -1061,4 +1061,3 @@ __STL_END_NAMESPACE ...@@ -1061,4 +1061,3 @@ __STL_END_NAMESPACE
// Local Variables: // Local Variables:
// mode:C++ // mode:C++
// End: // End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment