summaryrefslogtreecommitdiff
path: root/vendor/utfcpp/utf8
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-07-30 14:29:11 +0100
committerSadie Powell <sadie@witchery.services>2020-07-30 14:29:11 +0100
commit46390a54b3a0310a4662bae448031d853c61e8d7 (patch)
tree3d26f3d926a867901b1f91abc7508264bea7ed78 /vendor/utfcpp/utf8
parent428eea648d7088999411762513e199d99a9e77fe (diff)
Update vendored dependencies and fix update tool for Perl changes.
Diffstat (limited to 'vendor/utfcpp/utf8')
-rw-r--r--vendor/utfcpp/utf8/checked.h19
-rw-r--r--vendor/utfcpp/utf8/core.h17
-rw-r--r--vendor/utfcpp/utf8/unchecked.h7
3 files changed, 37 insertions, 6 deletions
diff --git a/vendor/utfcpp/utf8/checked.h b/vendor/utfcpp/utf8/checked.h
index c31861e0a..648636e46 100644
--- a/vendor/utfcpp/utf8/checked.h
+++ b/vendor/utfcpp/utf8/checked.h
@@ -42,7 +42,7 @@ namespace utf8
uint32_t cp;
public:
invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
- virtual const char* what() const throw() { return "Invalid code point"; }
+ virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};
@@ -50,7 +50,7 @@ namespace utf8
uint8_t u8;
public:
invalid_utf8 (uint8_t u) : u8(u) {}
- virtual const char* what() const throw() { return "Invalid UTF-8"; }
+ virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-8"; }
uint8_t utf8_octet() const {return u8;}
};
@@ -58,13 +58,13 @@ namespace utf8
uint16_t u16;
public:
invalid_utf16 (uint16_t u) : u16(u) {}
- virtual const char* what() const throw() { return "Invalid UTF-16"; }
+ virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-16"; }
uint16_t utf16_word() const {return u16;}
};
class not_enough_room : public exception {
public:
- virtual const char* what() const throw() { return "Not enough space"; }
+ virtual const char* what() const NOEXCEPT OVERRIDE { return "Not enough space"; }
};
/// The library API - functions intended to be called by the users
@@ -263,11 +263,16 @@ namespace utf8
// The iterator class
template <typename octet_iterator>
- class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
+ class iterator {
octet_iterator it;
octet_iterator range_start;
octet_iterator range_end;
public:
+ typedef uint32_t value_type;
+ typedef uint32_t* pointer;
+ typedef uint32_t& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it,
const octet_iterator& rangestart,
@@ -320,5 +325,9 @@ namespace utf8
} // namespace utf8
+#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
+#include "cpp11.h"
+#endif // C++ 11 or later
+
#endif //header guard
diff --git a/vendor/utfcpp/utf8/core.h b/vendor/utfcpp/utf8/core.h
index e007ca17d..244e89231 100644
--- a/vendor/utfcpp/utf8/core.h
+++ b/vendor/utfcpp/utf8/core.h
@@ -30,6 +30,23 @@ DEALINGS IN THE SOFTWARE.
#include <iterator>
+// Determine the C++ standard version.
+// If the user defines UTF_CPP_CPLUSPLUS, use that.
+// Otherwise, trust the unreliable predefined macro __cplusplus
+
+#if !defined UTF_CPP_CPLUSPLUS
+ #define UTF_CPP_CPLUSPLUS __cplusplus
+#endif
+
+#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
+ #define OVERRIDE override
+ #define NOEXCEPT noexcept
+#else // C++ 98/03
+ #define OVERRIDE
+ #define NOEXCEPT throw()
+#endif // C++ 11 or later
+
+
namespace utf8
{
// The typedefs for 8-bit, 16-bit and 32-bit unsigned integers
diff --git a/vendor/utfcpp/utf8/unchecked.h b/vendor/utfcpp/utf8/unchecked.h
index def000997..0e1b51cc7 100644
--- a/vendor/utfcpp/utf8/unchecked.h
+++ b/vendor/utfcpp/utf8/unchecked.h
@@ -217,9 +217,14 @@ namespace utf8
// The iterator class
template <typename octet_iterator>
- class iterator : public std::iterator <std::bidirectional_iterator_tag, uint32_t> {
+ class iterator {
octet_iterator it;
public:
+ typedef uint32_t value_type;
+ typedef uint32_t* pointer;
+ typedef uint32_t& reference;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::bidirectional_iterator_tag iterator_category;
iterator () {}
explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
// the default "big three" are OK