aboutsummaryrefslogtreecommitdiffstats
path: root/enc
diff options
context:
space:
mode:
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)