Support building on ruby 1.8 again, last commit broke ruby 1.8 version.

Noticed by naddy@
This commit is contained in:
jeremy 2017-01-07 18:09:28 +00:00
parent c4adeeb218
commit 8f9da5431f

View File

@ -1,18 +1,22 @@
$OpenBSD: patch-ext_mysql_api_mysql_c,v 1.1 2017/01/06 15:55:38 jeremy Exp $
$OpenBSD: patch-ext_mysql_api_mysql_c,v 1.2 2017/01/07 18:09:28 jeremy Exp $
Allow building with ruby 2.4+.
--- ext/mysql_api/mysql.c.orig Wed Dec 31 16:00:00 1969
+++ ext/mysql_api/mysql.c Tue Oct 18 14:23:24 2016
@@ -3,6 +3,7 @@
+++ ext/mysql_api/mysql.c Sat Jan 7 10:06:36 2017
@@ -3,6 +3,11 @@
*/
#include <ruby.h>
+#ifdef HAVE_RUBY_ENCODING_H
+#include <ruby/version.h>
+#else
+#define RUBY_API_VERSION_CODE 10807
+#endif
#ifndef RSTRING_PTR
#define RSTRING_PTR(str) RSTRING(str)->ptr
#endif
@@ -1317,7 +1318,11 @@ static VALUE stmt_bind_result(int argc, VALUE *argv, V
@@ -1317,7 +1322,11 @@ static VALUE stmt_bind_result(int argc, VALUE *argv, V
}
else if (argv[i] == rb_cString)
s->result.bind[i].buffer_type = MYSQL_TYPE_STRING;