+2002-01-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.h (ctype<char>::classic_table):
+ Remove definition.
+ (ctype<char>::_S_ctable): Remove.
+ * config/os/gnu-linux/bits/ctype_noninline.h
+ (ctype<char>::_S_table): Remove definition.
+ (ctype<char>::classic_table): Define.
+ (ctype<char>::ctype): Replace _S_ctable with classic_table().
+ * config/os/aix/bits/ctype_noninline.h: Same.
+ * config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
+ * config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
+ * config/os/djgpp/bits/ctype_noninline.h: Same.
+ * config/os/generic/bits/ctype_noninline.h: Same.
+ * config/os/gnu-linux/bits/ctype_noninline.h: Same.
+ * config/os/hpux/bits/ctype_noninline.h: Same.
+ * config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
+ * config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
+ * config/os/mingw32/bits/ctype_noninline.h: Same.
+ * config/os/newlib/bits/ctype_noninline.h: Same.
+ * config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
+ * config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
+ * config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
+
+2002-01-20 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/os/mingw32/bits/ctype_noninline.h: Declare _ctype instead
+ of _pctype. Use to define _S_ctable. Add definition for alternate
+ ctor. Initialise _M_ctable to _S_ctable in ctors.
+ (do_toupper, do_tolower): Use inline code appropriate for C-locale
+ rather than ::toupper, ::tolower.
+
2002-01-18 Loren Rittle <ljrittle@acm.org>
* testsuite/18_support/numeric_limits.cc (test_extrema<long double>):
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
-
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
+
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
+ _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
+ _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table())
{ }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
+ _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
+ _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : classic_table())
{ }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
// Information as gleaned from DJGPP <ctype.h>
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false,
size_t __refs = 0)
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
-
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
+
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table == 0 ? _S_ctable : __table)
+ _M_table(__table == 0 ? classic_table() : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table == 0 ? _S_ctable : __table)
+ _M_table(__table == 0 ? classic_table() : __table)
{ }
char
using _C_legacy::__ctype_b;
#endif
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b;
-
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return __ctype_b; }
+
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = NULL; }
#endif
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ _M_c_locale_ctype = NULL; }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
-
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
+
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
// Locale support -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2002 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
// Information as gleaned from /mingw32/include/ctype.h.
-// This should be in mingw's ctype.h but isn't in older versions
+ // This should be in mingw's ctype.h but isn't in older versions
+ // Static classic C-locale table. _ctype[0] is EOF
+ extern "C" unsigned short __declspec(dllimport) _ctype[];
- extern "C" unsigned short* __declspec(dllimport) _pctype;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return _ctype + 1; }
+
+ ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false,
+ size_t __refs = 0)
+ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(__table ? __table : classic_table())
+ { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
- : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(NULL), _M_tolower(NULL),
- _M_ctable(NULL), _M_table(__table == 0 ? (_pctype) : __table)
- { }
+ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_table(__table ? __table : classic_table())
+ { }
char
ctype<char>::do_toupper(char __c) const
- { return ::toupper((int) __c); }
+ { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
const char*
ctype<char>::do_toupper(char* __low, const char* __high) const
{
while (__low < __high)
{
- *__low = ::toupper((int) *__low);
+ *__low = this->do_toupper(*__low);
++__low;
}
return __high;
char
ctype<char>::do_tolower(char __c) const
- { return ::tolower((int) __c); }
+ { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
const char*
ctype<char>::do_tolower(char* __low, const char* __high) const
{
while (__low < __high)
{
- *__low = ::tolower((int) *__low);
+ *__low = this->do_tolower(*__low);
++__low;
}
return __high;
}
+
+
+
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
-
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
+
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return 0; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
char
// Information as gleaned from /usr/include/ctype.h
- // Data for classic_table().
- const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask;
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ { return __ctype_mask; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
- _M_table(__table ? __table : _S_ctable)
+ _M_table(__table ? __table : classic_table())
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
- _M_table(__table == 0 ? __table : _S_ctable)
+ _M_table(__table == 0 ? __table : classic_table())
{ }
char
public:
static locale::id id;
static const size_t table_size = 1 + static_cast<unsigned char>(-1);
- static const mask* _S_ctable;
explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
{ return _M_table; }
static const mask*
- classic_table() throw()
- { return _S_ctable; }
+ classic_table() throw();
virtual
~ctype();