diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/intern.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 5ff17a4971..063c5d059e 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -266,10 +266,12 @@ 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) +static inline void +rb_check_arity(int argc, int min, int max) +{ + if ((argc < min) || (max != UNLIMITED_ARGUMENTS && argc > max)) + rb_error_arity(argc, min, max); +} #if defined(NFDBITS) && defined(HAVE_RB_FD_INIT) typedef struct { |