diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-20 20:38:57 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-20 20:38:57 +0000 |
commit | 6204e0804b24f1675b49d5880da014411bcfb831 (patch) | |
tree | ce6c00bf078fc416936ca3cdc972b9b3c1c78dae /spec/ruby/optional/capi/ext/util_spec.c | |
parent | 58573c33e4720315ed27491e31dcc22892e1ce95 (diff) | |
download | ruby-6204e0804b24f1675b49d5880da014411bcfb831.tar.gz |
Update to ruby/spec@35a9fba
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/optional/capi/ext/util_spec.c')
-rw-r--r-- | spec/ruby/optional/capi/ext/util_spec.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/spec/ruby/optional/capi/ext/util_spec.c b/spec/ruby/optional/capi/ext/util_spec.c index 50795b51af..d99ed12e14 100644 --- a/spec/ruby/optional/capi/ext/util_spec.c +++ b/spec/ruby/optional/capi/ext/util_spec.c @@ -5,7 +5,6 @@ extern "C" { #endif -#ifdef HAVE_RB_SCAN_ARGS VALUE util_spec_rb_scan_args(VALUE self, VALUE argv, VALUE fmt, VALUE expected, VALUE acc) { int i, result, argc = (int)RARRAY_LEN(argv); VALUE args[6], failed, a1, a2, a3, a4, a5, a6; @@ -22,14 +21,19 @@ VALUE util_spec_rb_scan_args(VALUE self, VALUE argv, VALUE fmt, VALUE expected, switch(NUM2INT(expected)) { case 6: rb_ary_unshift(acc, a6); + /* FALLTHROUGH */ case 5: rb_ary_unshift(acc, a5); + /* FALLTHROUGH */ case 4: rb_ary_unshift(acc, a4); + /* FALLTHROUGH */ case 3: rb_ary_unshift(acc, a3); + /* FALLTHROUGH */ case 2: rb_ary_unshift(acc, a2); + /* FALLTHROUGH */ case 1: rb_ary_unshift(acc, a1); break; @@ -39,55 +43,31 @@ VALUE util_spec_rb_scan_args(VALUE self, VALUE argv, VALUE fmt, VALUE expected, return INT2NUM(result); } -#endif -#ifdef HAVE_RB_LONG2INT static VALUE util_spec_rb_long2int(VALUE self, VALUE n) { return INT2NUM(rb_long2int(NUM2LONG(n))); } -#endif -#ifdef HAVE_RB_ITER_BREAK static VALUE util_spec_rb_iter_break(VALUE self) { rb_iter_break(); return Qnil; } -#endif -#ifdef HAVE_RB_SOURCEFILE static VALUE util_spec_rb_sourcefile(VALUE self) { return rb_str_new2(rb_sourcefile()); } -#endif -#ifdef HAVE_RB_SOURCELINE static VALUE util_spec_rb_sourceline(VALUE self) { return INT2NUM(rb_sourceline()); } -#endif void Init_util_spec(void) { VALUE cls = rb_define_class("CApiUtilSpecs", rb_cObject); - -#ifdef HAVE_RB_SCAN_ARGS rb_define_method(cls, "rb_scan_args", util_spec_rb_scan_args, 4); -#endif - -#ifdef HAVE_RB_LONG2INT rb_define_method(cls, "rb_long2int", util_spec_rb_long2int, 1); -#endif - -#ifdef HAVE_RB_ITER_BREAK rb_define_method(cls, "rb_iter_break", util_spec_rb_iter_break, 0); -#endif - -#ifdef HAVE_RB_SOURCEFILE rb_define_method(cls, "rb_sourcefile", util_spec_rb_sourcefile, 0); -#endif - -#ifdef HAVE_RB_SOURCELINE rb_define_method(cls, "rb_sourceline", util_spec_rb_sourceline, 0); -#endif } #ifdef __cplusplus |