ruby-changes:48872
From: shugo <ko1@a...>
Date: Sun, 3 Dec 2017 17:03:03 +0900 (JST)
Subject: [ruby-changes:48872] shugo:r60990 (trunk): Init functions should have prefix to avoid confliction.
shugo 2017-12-03 17:02:56 +0900 (Sun, 03 Dec 2017) New Revision: 60990 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60990 Log: Init functions should have prefix to avoid confliction. Modified files: trunk/ext/-test-/string/capacity.c trunk/ext/-test-/string/coderange.c trunk/ext/-test-/string/cstr.c trunk/ext/-test-/string/ellipsize.c trunk/ext/-test-/string/enc_associate.c trunk/ext/-test-/string/enc_str_buf_cat.c trunk/ext/-test-/string/fstring.c trunk/ext/-test-/string/init.c trunk/ext/-test-/string/modify.c trunk/ext/-test-/string/new.c trunk/ext/-test-/string/nofree.c trunk/ext/-test-/string/normalize.c trunk/ext/-test-/string/qsort.c trunk/ext/-test-/string/set_len.c trunk/ext/-test-/time/init.c trunk/ext/-test-/time/new.c Index: ext/-test-/string/init.c =================================================================== --- ext/-test-/string/init.c (revision 60989) +++ ext/-test-/string/init.c (revision 60990) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/init.c#L1 #include "ruby.h" -#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);} +#define init(n) {void Init_string_##n(VALUE klass); Init_string_##n(klass);} void Init_string(void) Index: ext/-test-/string/qsort.c =================================================================== --- ext/-test-/string/qsort.c (revision 60989) +++ ext/-test-/string/qsort.c (revision 60990) @@ -55,7 +55,7 @@ bug_str_qsort_bang(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/qsort.c#L55 } void -Init_qsort(VALUE klass) +Init_string_qsort(VALUE klass) { rb_define_method(klass, "qsort!", bug_str_qsort_bang, -1); } Index: ext/-test-/string/cstr.c =================================================================== --- ext/-test-/string/cstr.c (revision 60989) +++ ext/-test-/string/cstr.c (revision 60990) @@ -131,7 +131,7 @@ bug_str_s_rb_str_new_frozen(VALUE self, https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/cstr.c#L131 } void -Init_cstr(VALUE klass) +Init_string_cstr(VALUE klass) { rb_define_method(klass, "cstr_term", bug_str_cstr_term, 0); rb_define_method(klass, "cstr_unterm", bug_str_cstr_unterm, 1); Index: ext/-test-/string/fstring.c =================================================================== --- ext/-test-/string/fstring.c (revision 60989) +++ ext/-test-/string/fstring.c (revision 60990) @@ -9,7 +9,7 @@ bug_s_fstring(VALUE self, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/fstring.c#L9 } void -Init_fstring(VALUE klass) +Init_string_fstring(VALUE klass) { rb_define_singleton_method(klass, "fstring", bug_s_fstring, 1); } Index: ext/-test-/string/nofree.c =================================================================== --- ext/-test-/string/nofree.c (revision 60989) +++ ext/-test-/string/nofree.c (revision 60990) @@ -7,7 +7,7 @@ bug_str_nofree(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/nofree.c#L7 } void -Init_nofree(VALUE klass) +Init_string_nofree(VALUE klass) { rb_define_singleton_method(klass, "nofree", bug_str_nofree, 0); } Index: ext/-test-/string/enc_str_buf_cat.c =================================================================== --- ext/-test-/string/enc_str_buf_cat.c (revision 60989) +++ ext/-test-/string/enc_str_buf_cat.c (revision 60990) @@ -8,7 +8,7 @@ enc_str_buf_cat(VALUE str, VALUE str2) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/enc_str_buf_cat.c#L8 } void -Init_enc_str_buf_cat(VALUE klass) +Init_string_enc_str_buf_cat(VALUE klass) { rb_define_method(klass, "enc_str_buf_cat", enc_str_buf_cat, 1); } Index: ext/-test-/string/coderange.c =================================================================== --- ext/-test-/string/coderange.c (revision 60989) +++ ext/-test-/string/coderange.c (revision 60990) @@ -36,7 +36,7 @@ str_coderange_scan(VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/coderange.c#L36 } void -Init_coderange(VALUE klass) +Init_string_coderange(VALUE klass) { sym_7bit = ID2SYM(rb_intern("7bit")); sym_valid = ID2SYM(rb_intern("valid")); Index: ext/-test-/string/modify.c =================================================================== --- ext/-test-/string/modify.c (revision 60989) +++ ext/-test-/string/modify.c (revision 60990) @@ -15,7 +15,7 @@ bug_str_modify_expand(VALUE str, VALUE e https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/modify.c#L15 } void -Init_modify(VALUE klass) +Init_string_modify(VALUE klass) { rb_define_method(klass, "modify!", bug_str_modify, 0); rb_define_method(klass, "modify_expand!", bug_str_modify_expand, 1); Index: ext/-test-/string/new.c =================================================================== --- ext/-test-/string/new.c (revision 60989) +++ ext/-test-/string/new.c (revision 60990) @@ -14,7 +14,7 @@ bug_external_str_new(VALUE self, VALUE l https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/new.c#L14 } void -Init_new(VALUE klass) +Init_string_new(VALUE klass) { rb_define_singleton_method(klass, "buf_new", bug_str_buf_new, 1); rb_define_singleton_method(klass, "external_new", bug_external_str_new, 2); Index: ext/-test-/string/set_len.c =================================================================== --- ext/-test-/string/set_len.c (revision 60989) +++ ext/-test-/string/set_len.c (revision 60990) @@ -8,7 +8,7 @@ bug_str_set_len(VALUE str, VALUE len) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/set_len.c#L8 } void -Init_set_len(VALUE klass) +Init_string_set_len(VALUE klass) { rb_define_method(klass, "set_len", bug_str_set_len, 1); } Index: ext/-test-/string/capacity.c =================================================================== --- ext/-test-/string/capacity.c (revision 60989) +++ ext/-test-/string/capacity.c (revision 60990) @@ -11,7 +11,7 @@ bug_str_capacity(VALUE klass, VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/capacity.c#L11 } void -Init_capacity(VALUE klass) +Init_string_capacity(VALUE klass) { rb_define_singleton_method(klass, "capacity", bug_str_capacity, 1); } Index: ext/-test-/string/ellipsize.c =================================================================== --- ext/-test-/string/ellipsize.c (revision 60989) +++ ext/-test-/string/ellipsize.c (revision 60990) @@ -7,7 +7,7 @@ bug_str_ellipsize(VALUE str, VALUE len) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/ellipsize.c#L7 } void -Init_ellipsize(VALUE klass) +Init_string_ellipsize(VALUE klass) { rb_define_method(klass, "ellipsize", bug_str_ellipsize, 1); } Index: ext/-test-/string/enc_associate.c =================================================================== --- ext/-test-/string/enc_associate.c (revision 60989) +++ ext/-test-/string/enc_associate.c (revision 60990) @@ -15,7 +15,7 @@ bug_str_encoding_index(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/enc_associate.c#L15 } void -Init_enc_associate(VALUE klass) +Init_string_enc_associate(VALUE klass) { rb_define_method(klass, "associate_encoding!", bug_str_enc_associate, 1); rb_define_singleton_method(klass, "encoding_index", bug_str_encoding_index, 1); Index: ext/-test-/string/normalize.c =================================================================== --- ext/-test-/string/normalize.c (revision 60989) +++ ext/-test-/string/normalize.c (revision 60990) @@ -11,7 +11,7 @@ normalize_ospath(VALUE str) https://github.com/ruby/ruby/blob/trunk/ext/-test-/string/normalize.c#L11 #endif void -Init_normalize(VALUE klass) +Init_string_normalize(VALUE klass) { rb_define_method(klass, "normalize_ospath", normalize_ospath, 0); } Index: ext/-test-/time/init.c =================================================================== --- ext/-test-/time/init.c (revision 60989) +++ ext/-test-/time/init.c (revision 60990) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/time/init.c#L1 #include "ruby.h" -#define init(n) {void Init_##n(VALUE klass); Init_##n(klass);} +#define init(n) {void Init_time_##n(VALUE klass); Init_time_##n(klass);} void Init_time(void) Index: ext/-test-/time/new.c =================================================================== --- ext/-test-/time/new.c (revision 60989) +++ ext/-test-/time/new.c (revision 60990) @@ -26,7 +26,7 @@ bug_time_s_timespec_now(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/-test-/time/new.c#L26 } void -Init_new(VALUE klass) +Init_time_new(VALUE klass) { rb_define_singleton_method(klass, "nano_new", bug_time_s_nano_new, 2); rb_define_singleton_method(klass, "timespec_new", bug_time_s_timespec_new, 3); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/