Sha256: 0b7a54a9073b3236bce3e3965b724b081034804cc209d184a1f23c5c1b95a13f

Contents?: true

Size: 803 Bytes

Versions: 70

Compression:

Stored size: 803 Bytes

Contents

#ifndef rb_check_arity

// https://github.com/ruby/ruby/blob/ruby_2_0_0/include/ruby/intern.h
// rb_check_arity was added in Ruby 2.0

#define UNLIMITED_ARGUMENTS (-1)

static inline void rb_error_arity(int argc, int min, int max)
{
  VALUE err_mess = 0;
  if (min == max) {
    err_mess = rb_sprintf("wrong number of arguments (%d for %d)", argc, min);
  }
  else if (max == UNLIMITED_ARGUMENTS) {
    err_mess = rb_sprintf("wrong number of arguments (%d for %d+)", argc, min);
  }
  else {
    err_mess = rb_sprintf("wrong number of arguments (%d for %d..%d)", argc, min, max);
  }
  rb_raise(rb_eTypeError, err_mess);
}

#define rb_check_arity(argc, min, max) do { \
  if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
  rb_error_arity(argc, min, max); \
} while(0)

#endif

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
concurrent-ruby-ext-1.0.2-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.2-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.2 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.1-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.1-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.1 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre5-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre5-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre5 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-0.9.2-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-0.9.2-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-0.9.2 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre4-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre4-x86-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre4 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre3-x64-mingw32 ext/concurrent/ruby_193_compatible.h
concurrent-ruby-ext-1.0.0.pre3-x86-mingw32 ext/concurrent/ruby_193_compatible.h