string, [...]: Revert recent change.

* string, std/straits.h, std/bastring.h: Revert recent change.  Needs
        some libiberty support before it can be re-enabled.

From-SVN: r25336
This commit is contained in:
Jeffrey A Law 1999-02-20 12:21:51 +00:00 committed by Jeff Law
parent 8a27a83e4a
commit 477d3dbc51
4 changed files with 11 additions and 13 deletions

View File

@ -1,3 +1,8 @@
Sat Feb 20 13:17:17 1999 Jeffrey A Law (law@cygnus.com)
* string, std/straits.h, std/bastring.h: Revert recent change. Needs
some libiberty support before it can be re-enabled.
Thu Feb 18 19:53:17 1999 Marc Espie <espie@cvs.openbsd.org>
* configure.in: Handle OpenBSD with and without threads.

View File

@ -298,8 +298,7 @@ private:
public:
const charT* c_str () const
{ if (length () == 0) return traits::empty();
terminate (); return data (); }
{ if (length () == 0) return ""; terminate (); return data (); }
void resize (size_type n, charT c);
void resize (size_type n)
{ resize (n, eos ()); }

View File

@ -40,8 +40,6 @@ template <class charT>
struct string_char_traits {
typedef charT char_type; // for users to acquire the basic character type
static const char_type __nullstr[1];
// constraints
static void assign (char_type& c1, const char_type& c2)
@ -53,10 +51,9 @@ struct string_char_traits {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return char_type(); } // the null character
static char_type* empty() { return __nullstr; }
static bool is_del(char_type a) { return 0; }
// characteristic function for delimiters of charT
// speed-up functions
static int compare (const char_type* s1, const char_type* s2, size_t n)
@ -68,7 +65,7 @@ struct string_char_traits {
return 0;
}
static size_t length (const char_type* s)
{
size_t l = 0;
@ -120,7 +117,6 @@ struct string_char_traits <char> {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
static char_type* empty() { return ""; }
static bool is_del(char_type a) { return isspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n)
@ -135,8 +131,8 @@ struct string_char_traits <char> {
{ return (char_type*) memset (s1, c, n); }
};
#if 0
#include <cwctype>
#include <cwchar>
struct string_char_traits <wchar_t> {
typedef wchar_t char_type;
@ -149,7 +145,6 @@ struct string_char_traits <wchar_t> {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
static char_type* empty() { return L""; }
static bool is_del(char_type a) { return iswspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n)
@ -158,10 +153,9 @@ struct string_char_traits <wchar_t> {
{ return wcslen (s); }
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{ return wmemcpy (s1, s2, n); }
static char_type* move (char_type* s1, const char_type* s2, size_t n)
{ return (char_type*) wmemmove (s1, s2, n); }
static char_type* set (char_type* s1, const char_type& c, size_t n)
{ return wmemset (s1, c, n); }
};
#endif
} // extern "C++"
#endif

View File

@ -7,7 +7,7 @@
extern "C++" {
typedef basic_string <char> string;
typedef basic_string <wchar_t> wstring;
// typedef basic_string <wchar_t> wstring;
} // extern "C++"
#endif