[前][次][番号順一覧][スレッド一覧]

ruby-changes:42945

From: duerst <ko1@a...>
Date: Mon, 16 May 2016 19:46:38 +0900 (JST)
Subject: [ruby-changes:42945] duerst:r55018 (trunk): * include/ruby/oniguruma.h: Introducing ONIG_CASE_MAPPING compilation

duerst	2016-05-16 19:46:32 +0900 (Mon, 16 May 2016)

  New Revision: 55018

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55018

  Log:
    * include/ruby/oniguruma.h: Introducing ONIG_CASE_MAPPING compilation
      switch
    * include/ruby/oniguruma.h, enc/unicode.h: Using ONIG_CASE_MAPPING
      compilation switch

  Modified files:
    trunk/ChangeLog
    trunk/enc/unicode.c
    trunk/include/ruby/oniguruma.h
Index: include/ruby/oniguruma.h
===================================================================
--- include/ruby/oniguruma.h	(revision 55017)
+++ include/ruby/oniguruma.h	(revision 55018)
@@ -128,14 +128,20 @@ typedef unsigned int OnigCaseFoldType; / https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L128
 
 ONIG_EXTERN OnigCaseFoldType OnigDefaultCaseFoldFlag;
 
+#define ONIG_CASE_MAPPING
+
+#ifdef ONIG_CASE_MAPPING
 /* bits for actual code point count; 3 bits is more than enough, currently only 2 used */
 #define OnigCodePointMaskWidth    3
 #define OnigCodePointMask     ((1<<OnigCodePointMaskWidth)-1)
 #define OnigCodePointCount(n) ((n)&OnigCodePointMask)
 #define OnigCaseFoldFlags(n) ((n)&~OnigCodePointMask)
+#endif   /* ONIG_CASE_MAPPING */
+
 /* #define ONIGENC_CASE_FOLD_HIRAGANA_KATAKANA  (1<<1) */ /* no longer usable with these values! */
 /* #define ONIGENC_CASE_FOLD_KATAKANA_WIDTH     (1<<2) */ /* no longer usable with these values! */
 
+#ifdef ONIG_CASE_MAPPING
 /* bits for index into table with separate titlecase mappings */
 /* 10 bits provide 1024 values */
 #define OnigSpecialIndexShift 3
@@ -149,10 +155,16 @@ ONIG_EXTERN OnigCaseFoldType OnigDefault https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L155
 #define ONIGENC_CASE_DOWN_SPECIAL               (1<<17) /* has special downcase mapping */
 #define ONIGENC_CASE_MODIFIED                   (1<<18) /* data has been modified */
 #define ONIGENC_CASE_FOLD                       (1<<19) /* has/needs case folding */
+#endif   /* ONIG_CASE_MAPPING */
+
 #define ONIGENC_CASE_FOLD_TURKISH_AZERI         (1<<20) /* needs mapping specific to Turkic languages; better not change original value! */
+
+#ifdef ONIG_CASE_MAPPING
 #define ONIGENC_CASE_FOLD_LITHUANIAN            (1<<21) /* needs Lithuanian-specific mapping */
 #define ONIGENC_CASE_ASCII_ONLY                 (1<<22) /* only modify ASCII range */
 #define ONIGENC_CASE_IS_TITLECASE               (1<<23) /* character itself is already titlecase */
+#endif   /* ONIG_CASE_MAPPING */
+
 #define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR   (1<<30) /* better not change original value! */
 
 #define ONIGENC_CASE_FOLD_MIN      INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55017)
+++ ChangeLog	(revision 55018)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon May 16 19:46:33 2016  Martin Duerst  <duerst@i...>
+
+	* include/ruby/oniguruma.h: Introducing ONIG_CASE_MAPPING compilation
+	  switch
+
+	* include/ruby/oniguruma.h, enc/unicode.h: Using ONIG_CASE_MAPPING
+	  compilation switch
+
 Mon May 16 19:29:31 2016  SHIBATA Hiroshi  <hsbt@r...>
 
 	* gems/bundled_gems: Update xmlrpc-0.1.1. xmlrpc-0.1.0 didn't allow
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 55017)
+++ enc/unicode.c	(revision 55018)
@@ -651,6 +651,8 @@ onigenc_unicode_get_case_fold_codes_by_s https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L651
   return n;
 }
 
+#ifdef ONIG_CASE_MAPPING
+
 /* length in bytes for three characters in UTF-32; e.g. needed for ffi (U+FB03) */
 #define CASE_MAPPING_SLACK 12
 #define MODIFIED (flags |= ONIGENC_CASE_MODIFIED)
@@ -779,3 +781,5 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L781
     *flagP = flags;
     return (int)(to-to_start);
 }
+
+#endif   /* ONIG_CASE_MAPPING */
\ No newline at end of file

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]