Ruby 1.9.3 compatibility no longer existed

This commit is contained in:
Chris Seaton 2022-03-16 00:15:52 +00:00
parent 521e9dcef4
commit 13f44b3708
3 changed files with 0 additions and 30 deletions

View File

@ -2,7 +2,6 @@
#include "atomic_boolean.h"
#include "atomic_reference.h"
#include "ruby_193_compatible.h"
void atomic_boolean_mark(void *value) {
rb_gc_mark_maybe((VALUE) value);

View File

@ -2,7 +2,6 @@
#include "atomic_fixnum.h"
#include "atomic_reference.h"
#include "ruby_193_compatible.h"
void atomic_fixnum_mark(void *value) {
rb_gc_mark_maybe((VALUE) value);

View File

@ -1,28 +0,0 @@
#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 VALUE 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);
}
return rb_exc_new3(rb_eTypeError, err_mess);
}
#define rb_check_arity(argc, min, max) do { \
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
rb_exc_raise(rb_error_arity(argc, min, max)); \
} while(0)
#endif