1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* re.c (Init_Regexp): test DEFAULT_KCODE in C code because

KCODE_EUC, etc are enum.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-09-29 19:06:40 +00:00
parent 38694262ef
commit 910b0709ed
2 changed files with 13 additions and 13 deletions

View file

@ -1,3 +1,8 @@
Sun Sep 30 04:03:43 2007 Tanaka Akira <akr@fsij.org>
* re.c (Init_Regexp): test DEFAULT_KCODE in C code because
KCODE_EUC, etc are enum.
Sun Sep 30 00:55:40 2007 NAKAMURA Usaku <usa@ruby-lang.org> Sun Sep 30 00:55:40 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* variable.c (obj_ivar_each): get rid of warning. * variable.c (obj_ivar_each): get rid of warning.

13
re.c
View file

@ -2433,19 +2433,14 @@ Init_Regexp(void)
rb_eRegexpError = rb_define_class("RegexpError", rb_eStandardError); rb_eRegexpError = rb_define_class("RegexpError", rb_eStandardError);
onigenc_set_default_caseconv_table((UChar*)casetable); onigenc_set_default_caseconv_table((UChar*)casetable);
#if DEFAULT_KCODE == KCODE_EUC if (DEFAULT_KCODE == KCODE_EUC)
onigenc_set_default_encoding(ONIG_ENCODING_EUC_JP); onigenc_set_default_encoding(ONIG_ENCODING_EUC_JP);
#else else if (DEFAULT_KCODE == KCODE_SJIS)
#if DEFAULT_KCODE == KCODE_SJIS
onigenc_set_default_encoding(ONIG_ENCODING_SJIS); onigenc_set_default_encoding(ONIG_ENCODING_SJIS);
#else else if (DEFAULT_KCODE == KCODE_UTF8)
#if DEFAULT_KCODE == KCODE_UTF8
onigenc_set_default_encoding(ONIG_ENCODING_UTF8); onigenc_set_default_encoding(ONIG_ENCODING_UTF8);
#else else
onigenc_set_default_encoding(ONIG_ENCODING_ASCII); onigenc_set_default_encoding(ONIG_ENCODING_ASCII);
#endif
#endif
#endif
rb_define_virtual_variable("$~", match_getter, match_setter); rb_define_virtual_variable("$~", match_getter, match_setter);
rb_define_virtual_variable("$&", last_match_getter, 0); rb_define_virtual_variable("$&", last_match_getter, 0);