diff --git a/ext/cbson/cbson.c b/ext/cbson/cbson.c index 9b34a7f..d5adb97 100644 --- a/ext/cbson/cbson.c +++ b/ext/cbson/cbson.c @@ -30,10 +30,16 @@ #ifndef RSTRING_LEN # define RSTRING_LEN(v) RSTRING(v)->len #endif +#ifndef RSTRING_LENINT +# define RSTRING_LENINT(v) rb_long2int(RSTRING_LEN(v)) +#endif #ifndef RARRAY_LEN # define RARRAY_LEN(v) RARRAY(v)->len #endif +#ifndef RARRAY_LENINT +# define RARRAY_LENINT(v) rb_long2int(RARRAY_LEN(v)) +#endif #if HAVE_RUBY_ST_H #include "ruby/st.h"