Commit 477d3dbc by Jeffrey A Law Committed by Jeff Law

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
parent 8a27a83e
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> Thu Feb 18 19:53:17 1999 Marc Espie <espie@cvs.openbsd.org>
* configure.in: Handle OpenBSD with and without threads. * configure.in: Handle OpenBSD with and without threads.
......
...@@ -298,8 +298,7 @@ private: ...@@ -298,8 +298,7 @@ private:
public: public:
const charT* c_str () const const charT* c_str () const
{ if (length () == 0) return traits::empty(); { if (length () == 0) return ""; terminate (); return data (); }
terminate (); return data (); }
void resize (size_type n, charT c); void resize (size_type n, charT c);
void resize (size_type n) void resize (size_type n)
{ resize (n, eos ()); } { resize (n, eos ()); }
......
...@@ -40,8 +40,6 @@ template <class charT> ...@@ -40,8 +40,6 @@ template <class charT>
struct string_char_traits { struct string_char_traits {
typedef charT char_type; // for users to acquire the basic character type typedef charT char_type; // for users to acquire the basic character type
static const char_type __nullstr[1];
// constraints // constraints
static void assign (char_type& c1, const char_type& c2) static void assign (char_type& c1, const char_type& c2)
...@@ -53,7 +51,6 @@ struct string_char_traits { ...@@ -53,7 +51,6 @@ struct string_char_traits {
static bool lt (const char_type& c1, const char_type& c2) static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); } { return (c1 < c2); }
static char_type eos () { return char_type(); } // the null character 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; } static bool is_del(char_type a) { return 0; }
// characteristic function for delimiters of charT // characteristic function for delimiters of charT
...@@ -120,7 +117,6 @@ struct string_char_traits <char> { ...@@ -120,7 +117,6 @@ struct string_char_traits <char> {
static bool lt (const char_type& c1, const char_type& c2) static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); } { return (c1 < c2); }
static char_type eos () { return 0; } static char_type eos () { return 0; }
static char_type* empty() { return ""; }
static bool is_del(char_type a) { return isspace(a); } static bool is_del(char_type a) { return isspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n) static int compare (const char_type* s1, const char_type* s2, size_t n)
...@@ -135,8 +131,8 @@ struct string_char_traits <char> { ...@@ -135,8 +131,8 @@ struct string_char_traits <char> {
{ return (char_type*) memset (s1, c, n); } { return (char_type*) memset (s1, c, n); }
}; };
#if 0
#include <cwctype> #include <cwctype>
#include <cwchar>
struct string_char_traits <wchar_t> { struct string_char_traits <wchar_t> {
typedef wchar_t char_type; typedef wchar_t char_type;
...@@ -149,7 +145,6 @@ struct string_char_traits <wchar_t> { ...@@ -149,7 +145,6 @@ struct string_char_traits <wchar_t> {
static bool lt (const char_type& c1, const char_type& c2) static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); } { return (c1 < c2); }
static char_type eos () { return 0; } static char_type eos () { return 0; }
static char_type* empty() { return L""; }
static bool is_del(char_type a) { return iswspace(a); } static bool is_del(char_type a) { return iswspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n) static int compare (const char_type* s1, const char_type* s2, size_t n)
...@@ -158,10 +153,9 @@ struct string_char_traits <wchar_t> { ...@@ -158,10 +153,9 @@ struct string_char_traits <wchar_t> {
{ return wcslen (s); } { return wcslen (s); }
static char_type* copy (char_type* s1, const char_type* s2, size_t n) static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{ return wmemcpy (s1, s2, 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) static char_type* set (char_type* s1, const char_type& c, size_t n)
{ return wmemset (s1, c, n); } { return wmemset (s1, c, n); }
}; };
#endif
} // extern "C++" } // extern "C++"
#endif #endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
extern "C++" { extern "C++" {
typedef basic_string <char> string; typedef basic_string <char> string;
typedef basic_string <wchar_t> wstring; // typedef basic_string <wchar_t> wstring;
} // extern "C++" } // extern "C++"
#endif #endif
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