diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/intern.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 763472589b..cf36aa6265 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -256,6 +256,12 @@ int rb_sourceline(void); const char *rb_sourcefile(void); VALUE rb_check_funcall(VALUE, ID, int, VALUE*); +NORETURN(void rb_error_arity(int, int, int)); +#define rb_check_arity(argc, min, max) do { \ + if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \ + rb_error_arity(argc, min, max); \ + } while(0) + #if defined(NFDBITS) && defined(HAVE_RB_FD_INIT) typedef struct { int maxfd; |