From 37c98eaad76b7f1bf86c75fe2c32cf6aa11f7c6f Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 13 May 2016 19:32:21 +0000 Subject: SpellChecker: Updated hunspell to 1.4.1 git-svn-id: http://svn.miranda-ng.org/main/trunk@16828 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- libs/hunspell/src/w_char.hxx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'libs/hunspell/src/w_char.hxx') 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 { -- cgit v1.2.3