summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:55:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 07:55:11 +0000
commitf0e73fc9862c8d2c57a89349fb79012b826b8245 (patch)
treeb9019d2cb6547e8f0c8e5b992c0a05b814cd5be6
parent32145ebfd6b69f833e7f5bddb6968a702499eb67 (diff)
ruby/ruby.h: rb_block_call_func_t
* include/ruby/ruby.h (rb_block_call_func_t): strict check for rb_block_call_func* if RB_BLOCK_CALL_FUNC_STRICT is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--include/ruby/ruby.h8
-rw-r--r--internal.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 5496213..f2f65b9 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1496,6 +1496,12 @@ PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
typedef VALUE rb_block_call_func(VALUE, VALUE, int, VALUE*, VALUE);
#define RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG 1
+#if defined RB_BLOCK_CALL_FUNC_STRICT && RB_BLOCK_CALL_FUNC_STRICT
+typedef rb_block_call_func *rb_block_call_func_t;
+#else
+typedef VALUE (*rb_block_call_func_t)(ANYARGS);
+#endif
+
VALUE rb_each(VALUE);
VALUE rb_yield(VALUE);
VALUE rb_yield_values(int n, ...);
@@ -1504,7 +1510,7 @@ VALUE rb_yield_splat(VALUE);
int rb_block_given_p(void);
void rb_need_block(void);
VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_block_call(VALUE,ID,int,VALUE*,VALUE(*)(ANYARGS),VALUE);
+VALUE rb_block_call(VALUE,ID,int,VALUE*,rb_block_call_func_t,VALUE);
VALUE rb_rescue(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
VALUE rb_rescue2(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...);
VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
diff --git a/internal.h b/internal.h
index 2895613..2849f4b 100644
--- a/internal.h
+++ b/internal.h
@@ -751,7 +751,7 @@ void rb_print_backtrace(void);
/* vm_eval.c */
void Init_vm_eval(void);
VALUE rb_current_realfilepath(void);
-VALUE rb_check_block_call(VALUE, ID, int, VALUE *, VALUE (*)(ANYARGS), VALUE);
+VALUE rb_check_block_call(VALUE, ID, int, VALUE *, rb_block_call_func_t, VALUE);
typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
rb_check_funcall_hook *hook, VALUE arg);