aboutsummaryrefslogtreecommitdiffstats
path: root/enc
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 09:39:54 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 09:39:54 +0000
commit4b15b54d680bbb6e97673e67085ed4f70b612ccb (patch)
tree2ce22b0f45a8a3de7db95f9e120d49df1acc2720 /enc
parentea5e885a958967c999e15512c6e72defab232de4 (diff)
downloadruby-4b15b54d680bbb6e97673e67085ed4f70b612ccb.tar.gz
* include/ruby/oniguruma.h, enc/unicode.c: Adjusting flag assignments
and macros to work with unified CaseMappingSpecials array. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-rw-r--r--enc/unicode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index d4b2c2c427..f4487e40d5 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -137,6 +137,7 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
return 1;
}
+/* macros to shorten "enc/unicode/casefold.h", undefined immediately after including the file */
#define U ONIGENC_CASE_UPCASE
#define D ONIGENC_CASE_DOWNCASE
#define F ONIGENC_CASE_FOLD
@@ -157,6 +158,12 @@ code3_equal(const OnigCodePoint *x, const OnigCodePoint *y)
#undef I
#undef L
+/* macros related to ONIGENC_CASE flags */
+/* defined here because not used in other files */
+#define OnigSpecialIndexMask (((1<<OnigSpecialIndexWidth)-1)<<OnigSpecialIndexWidth)
+#define OnigSpecialIndexEncode(n) (((n)<<OnigSpecialIndexShift)&OnigSpecialIndexMask)
+#define OnigSpecialIndexDecode(n) (((n)&OnigSpecialIndexMask)>>OnigSpecialIndexShift)
+
#include "enc/unicode/name2ctype.h"
#define CODE_RANGES_NUM numberof(CodeRanges)