summaryrefslogtreecommitdiff
path: root/libs/hunspell/src/w_char.hxx
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2016-05-13 19:32:21 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2016-05-13 19:32:21 +0000
commit37c98eaad76b7f1bf86c75fe2c32cf6aa11f7c6f (patch)
tree32aede144aa0cd0f2dd058b003cdbd534a2f969c /libs/hunspell/src/w_char.hxx
parente73bb3845517a31fa795e8d2174fcc8572835b33 (diff)
SpellChecker: Updated hunspell to 1.4.1
git-svn-id: http://svn.miranda-ng.org/main/trunk@16828 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'libs/hunspell/src/w_char.hxx')
-rw-r--r--libs/hunspell/src/w_char.hxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/libs/hunspell/src/w_char.hxx b/libs/hunspell/src/w_char.hxx
index 9de7989f4f..336c454f79 100644
--- a/libs/hunspell/src/w_char.hxx
+++ b/libs/hunspell/src/w_char.hxx
@@ -42,13 +42,27 @@
#define __WCHARHXX__
#ifndef GCC
-typedef struct {
+struct w_char {
#else
-typedef struct __attribute__((packed)) {
+struct __attribute__((packed)) w_char {
#endif
unsigned char l;
unsigned char h;
-} w_char;
+
+ friend bool operator<(const w_char a, const w_char b) {
+ unsigned short a_idx = (a.h << 8) + a.l;
+ unsigned short b_idx = (b.h << 8) + b.l;
+ return a_idx < b_idx;
+ }
+
+ friend bool operator==(const w_char a, const w_char b) {
+ return (((a).l == (b).l) && ((a).h == (b).h));
+ }
+
+ friend bool operator!=(const w_char a, const w_char b) {
+ return !(a == b);;
+ }
+};
// two character arrays
struct replentry {