Skip to content

Commit 3048bbb

Browse files
committed
Fixed broken compile on 1.9.3 due to missing rb_check_arity (added in 2.0.0).
1 parent 3953f40 commit 3048bbb

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

ext/concurrent_ruby_ext/atomic_boolean.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "atomic_boolean.h"
44
#include "atomic_reference.h"
5+
#include "common.h"
56

67
void atomic_boolean_mark(void *value) {
78
rb_gc_mark_maybe((VALUE) value);

ext/concurrent_ruby_ext/atomic_fixnum.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "atomic_fixnum.h"
44
#include "atomic_reference.h"
5+
#include "common.h"
56

67
void atomic_fixnum_mark(void *value) {
78
rb_gc_mark_maybe((VALUE) value);

ext/concurrent_ruby_ext/common.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef rb_check_arity
2+
3+
// https://github.com/ruby/ruby/blob/ruby_2_0_0/include/ruby/intern.h
4+
// rb_check_arity was added in Ruby 2.0
5+
6+
#define rb_check_arity(argc, min, max) do { \
7+
if (((argc) < (min)) || ((argc) > (max) && (max) != UNLIMITED_ARGUMENTS)) \
8+
rb_error_arity(argc, min, max); \
9+
} while(0)
10+
11+
#endif

0 commit comments

Comments
 (0)