mirror of
https://github.com/netbirdio/FreeBSD-ports.git
synced 2026-05-22 18:42:42 -07:00
The base template for std::char_traits<> has been removed in LLVM 19; specializations are only provided for char, wchar_t, char8_t, char16_t, and char32_t. This had severely impacted GNU APL which derived its UTF8 and UCS string classes from std::basic_string<>. The author had made several attempts to convert these classes to use std::vector<> instead. Carefully cherry-pick required changes so these fixes could be applied on top of version 1.8 as trunk had diverged significantly. Obtained from: upstream (SVN revisions 1823, 1831, and 1837) Reported by: pkg-fallout
30 lines
1.0 KiB
C++
30 lines
1.0 KiB
C++
--- src/UTF8_string.hh.orig 2019-06-23 12:39:20 UTC
|
|
+++ src/UTF8_string.hh
|
|
@@ -45,7 +45,7 @@ utf8P(const void * vp)
|
|
}
|
|
//-----------------------------------------------------------------------------
|
|
/// an UTF8 encoded Unicode (RFC 3629) string
|
|
-class UTF8_string : public std::basic_string<UTF8>
|
|
+class UTF8_string : public std::string
|
|
{
|
|
public:
|
|
/// constructor: empty UTF8_string
|
|
@@ -79,15 +79,9 @@ class UTF8_string : public std::basic_string<UTF8> (pu
|
|
return true;
|
|
}
|
|
|
|
- /// return \b this string as a 0-termionated C string
|
|
- const char * c_str() const
|
|
- { return reinterpret_cast<const char *>
|
|
- (std::basic_string<UTF8>::c_str()); }
|
|
-
|
|
- /// prevent basic_string::erase() with its dangerous default value for
|
|
- /// the number of erased character.
|
|
+ /// erase one item at \b pos
|
|
void erase(size_t pos)
|
|
- { basic_string::erase(pos, 1); }
|
|
+ { std::string::erase(begin() + pos); }
|
|
|
|
/// return the last byte in this string
|
|
UTF8 back() const
|