summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-07-22 14:04:25 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-07-22 14:04:25 -0700
commitba84d91986c2d149f0a05132401e8ad9d17dab6c (patch)
treee25c9e1eafde2aedb2548b6db4fef3be76defbd9 /ext
parent64a800e4a4e1e67c0df43e95ccde08158c926c84 (diff)
downloadffi-yajl-ba84d91986c2d149f0a05132401e8ad9d17dab6c.tar.gz
replace Fixnum+Bignum with Integer?
i think that's all we have to do?
Diffstat (limited to 'ext')
-rw-r--r--ext/ffi_yajl/ext/encoder/encoder.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/ffi_yajl/ext/encoder/encoder.c b/ext/ffi_yajl/ext/encoder/encoder.c
index 92f64a9..6f1492c 100644
--- a/ext/ffi_yajl/ext/encoder/encoder.c
+++ b/ext/ffi_yajl/ext/encoder/encoder.c
@@ -377,8 +377,12 @@ void Init_encoder() {
rb_define_method(rb_cNilClass, "ffi_yajl", rb_cNilClass_ffi_yajl, 2);
rb_define_method(rb_cTrueClass, "ffi_yajl", rb_cTrueClass_ffi_yajl, 2);
rb_define_method(rb_cFalseClass, "ffi_yajl", rb_cFalseClass_ffi_yajl, 2);
+#ifdef rb_cFixnum /* ruby < 2.4 */
rb_define_method(rb_cFixnum, "ffi_yajl", rb_cFixnum_ffi_yajl, 2);
rb_define_method(rb_cBignum, "ffi_yajl", rb_cBignum_ffi_yajl, 2);
+#else
+ rb_define_method(rb_cInteger, "ffi_yajl", rb_cFixnum_ffi_yajl, 2);
+#endif
rb_define_method(rb_cFloat, "ffi_yajl", rb_cFloat_ffi_yajl, 2);
rb_define_method(rb_cString, "ffi_yajl", rb_cString_ffi_yajl, 2);
rb_define_method(rb_cSymbol, "ffi_yajl", rb_cSymbol_ffi_yajl, 2);