From 42ee6c706f9075e95c8e296cdfbb07b3bad429d4 Mon Sep 17 00:00:00 2001 From: Po Shan Cheah Date: Wed, 28 Dec 2016 15:56:31 -0500 Subject: [PATCH] Fix for Ruby 2.4.0 integer unification As of Ruby 2.4.0, Fixnum and Bignum have been unified into the Integer type. So rb_cFixnum is no longer defined. Fortunately, ruby.h defines RUBY_INTEGER_UNIFICATION if rb_cFixnum is no longer available, so we can check that. --- ext/mysql.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/mysql.c b/ext/mysql.c index cbad5bd..782742e 100644 --- a/ext/mysql.c +++ b/ext/mysql.c @@ -1850,7 +1850,11 @@ static VALUE stmt_bind_result(int argc, VALUE *argv, VALUE obj) } else if (argv[i] == rb_cString) s->result.bind[i].buffer_type = MYSQL_TYPE_STRING; - else if (argv[i] == rb_cNumeric || argv[i] == rb_cInteger || argv[i] == rb_cFixnum) + else if (argv[i] == rb_cNumeric || argv[i] == rb_cInteger +#ifndef RUBY_INTEGER_UNIFICATION + || argv[i] == rb_cFixnum +#endif + ) s->result.bind[i].buffer_type = MYSQL_TYPE_LONGLONG; else if (argv[i] == rb_cFloat) s->result.bind[i].buffer_type = MYSQL_TYPE_DOUBLE;