summaryrefslogtreecommitdiff
path: root/strings/strings_def.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
commitf62c12b405ba7ec80b8e2490856b83c6f5899211 (patch)
tree010605c7f145da6ea6ac14b39abc4cf700d619b1 /strings/strings_def.h
parentf947f73b2b6d2bd246b81a9038224d2a85777520 (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-f62c12b405ba7ec80b8e2490856b83c6f5899211.tar.gz
Merge 10.0.14 into 10.1
Diffstat (limited to 'strings/strings_def.h')
-rw-r--r--strings/strings_def.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/strings/strings_def.h b/strings/strings_def.h
index 6bd8e8f5575..fb280b6bb6b 100644
--- a/strings/strings_def.h
+++ b/strings/strings_def.h
@@ -100,4 +100,13 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
end--;
return (end);
}
+
+/* Macros for hashing characters */
+
+#define MY_HASH_ADD(A, B, value) \
+ do { A^= (((A & 63)+B)*((value)))+ (A << 8); B+=3; } while(0)
+
+#define MY_HASH_ADD_16(A, B, value) \
+ do { MY_HASH_ADD(A, B, ((value) & 0xFF)) ; MY_HASH_ADD(A, B, ((value >>8 ))); } while(0)
+
#endif