diff options
author | taca <taca@pkgsrc.org> | 2017-06-12 17:06:18 +0000 |
---|---|---|
committer | taca <taca@pkgsrc.org> | 2017-06-12 17:06:18 +0000 |
commit | 67306eb8fe1a480c54128902716fc925de07029a (patch) | |
tree | ac997a0ae26038147140aeed872b3607a1009033 /databases/sqlrelay | |
parent | 79c2b98758c7d04a57fdf1addf6d9e31dae42dc9 (diff) | |
download | pkgsrc-67306eb8fe1a480c54128902716fc925de07029a.tar.gz |
Add fix for Ruby 2.4 and later.
Diffstat (limited to 'databases/sqlrelay')
-rw-r--r-- | databases/sqlrelay/distinfo | 4 | ||||
-rw-r--r-- | databases/sqlrelay/patches/patch-src_api_ruby_rubyincludes1.h | 9 | ||||
-rw-r--r-- | databases/sqlrelay/patches/patch-src_api_ruby_sqlrelay.cpp | 77 |
3 files changed, 89 insertions, 1 deletions
diff --git a/databases/sqlrelay/distinfo b/databases/sqlrelay/distinfo index 7cd8d67c12d..c3c9d24ce60 100644 --- a/databases/sqlrelay/distinfo +++ b/databases/sqlrelay/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.22 2017/01/16 13:13:13 fhajny Exp $ +$NetBSD: distinfo,v 1.23 2017/06/12 17:06:18 taca Exp $ SHA1 (sqlrelay-1.0.0.tar.gz) = 3f350a71fea8177a8e003524b6833347f741153b RMD160 (sqlrelay-1.0.0.tar.gz) = 1bc6c1ac02eb8a58c1aa8e2bacd0c8662a283aad @@ -12,3 +12,5 @@ SHA1 (patch-src_api_nodejs_package__in.json) = 76e2ebc4e47d5ef38d0c96059b62460fe SHA1 (patch-src_api_php_sql__relay.cpp) = 9e33260f4e4331874187e5b30db17d4478710385 SHA1 (patch-src_api_ruby_getcflags.rb) = 033e26ef03db4851f493d831c37ec947662d47ee SHA1 (patch-src_api_ruby_getsitearchdir.rb) = 603c66ed45f854b833eefbcdbd58e41465fb8120 +SHA1 (patch-src_api_ruby_rubyincludes1.h) = 7b06afbbdfc4d0ab4fd1288336eea795f4e1bce7 +SHA1 (patch-src_api_ruby_sqlrelay.cpp) = 3081ffd0e2a373c14e6dd602728f72a1dfb6461b diff --git a/databases/sqlrelay/patches/patch-src_api_ruby_rubyincludes1.h b/databases/sqlrelay/patches/patch-src_api_ruby_rubyincludes1.h new file mode 100644 index 00000000000..01d1f9faad6 --- /dev/null +++ b/databases/sqlrelay/patches/patch-src_api_ruby_rubyincludes1.h @@ -0,0 +1,9 @@ +$NetBSD: patch-src_api_ruby_rubyincludes1.h,v 1.1 2017/06/12 17:06:18 taca Exp $ + +Use better cast for Ruby 2.1 and later. + +--- src/api/ruby/rubyincludes1.h.orig 2016-12-20 08:40:41.000000000 +0000 ++++ src/api/ruby/rubyincludes1.h +@@ -1 +1 @@ +-#define CAST VALUE(*)() ++#define CAST VALUE(*)(ANYARGS) diff --git a/databases/sqlrelay/patches/patch-src_api_ruby_sqlrelay.cpp b/databases/sqlrelay/patches/patch-src_api_ruby_sqlrelay.cpp new file mode 100644 index 00000000000..cc0a4662e06 --- /dev/null +++ b/databases/sqlrelay/patches/patch-src_api_ruby_sqlrelay.cpp @@ -0,0 +1,77 @@ +$NetBSD: patch-src_api_ruby_sqlrelay.cpp,v 1.1 2017/06/12 17:06:18 taca Exp $ + +Fix for Ruby 2.4 and later. + +--- src/api/ruby/sqlrelay.cpp.orig 2016-12-20 08:40:41.000000000 +0000 ++++ src/api/ruby/sqlrelay.cpp +@@ -922,9 +922,11 @@ static VALUE sqlrcur_substitution(int ar + Data_Get_Struct(self,sqlrcursor,sqlrcur); + if (rb_obj_is_instance_of(value,rb_cString)==Qtrue) { + sqlrcur->substitution(STR2CSTR(variable),STR2CSTR(value)); +- } else if (rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || ++ } else if (rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#ifndef RUBY_INTEGER_UNIFICATION ++ rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || + rb_obj_is_instance_of(value,rb_cFixnum)==Qtrue || +- rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#endif + rb_obj_is_instance_of(value,rb_cNumeric)==Qtrue) { + sqlrcur->substitution(STR2CSTR(variable),NUM2INT(value)); + } else if (rb_obj_is_instance_of(value,rb_cFloat)==Qtrue) { +@@ -958,9 +960,12 @@ static VALUE sqlrcur_inputBind(int argc, + rb_scan_args(argc,argv,"22",&variable,&value,&precision,&scale); + Data_Get_Struct(self,sqlrcursor,sqlrcur); + if (rb_obj_is_instance_of(value,rb_cString)==Qtrue) { +- if ((rb_obj_is_instance_of(precision,rb_cBignum)==Qtrue || ++ if ((rb_obj_is_instance_of(precision,rb_cInteger)==Qtrue || ++ ++#ifndef RUBY_INTEGER_UNIFICATION ++ rb_obj_is_instance_of(precision,rb_cBignum)==Qtrue || + rb_obj_is_instance_of(precision,rb_cFixnum)==Qtrue || +- rb_obj_is_instance_of(precision,rb_cInteger)==Qtrue || ++#endif + rb_obj_is_instance_of(precision,rb_cNumeric)==Qtrue) && + NUM2INT(precision)>0) { + // in this case, the precision parameter is actually +@@ -970,9 +975,11 @@ static VALUE sqlrcur_inputBind(int argc, + } else { + sqlrcur->inputBind(STR2CSTR(variable),STR2CSTR(value)); + } +- } else if (rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || ++ } else if (rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#ifndef RUBY_INTEGER_UNIFICATION ++ rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || + rb_obj_is_instance_of(value,rb_cFixnum)==Qtrue || +- rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#endif + rb_obj_is_instance_of(value,rb_cNumeric)==Qtrue) { + sqlrcur->inputBind(STR2CSTR(variable),NUM2INT(value)); + } else if (rb_obj_is_instance_of(value,rb_cFloat)==Qtrue) { +@@ -1140,9 +1147,11 @@ static VALUE sqlrcur_substitutions(int a + if (rb_obj_is_instance_of(value,rb_cString)==Qtrue) { + sqlrcur->substitution(STR2CSTR(variable), + STR2CSTR(value)); +- } else if (rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || ++ } else if (rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#ifndef RUBY_INTEGER_UNIFICATION ++ rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || + rb_obj_is_instance_of(value,rb_cFixnum)==Qtrue || +- rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#endif + rb_obj_is_instance_of(value,rb_cNumeric)==Qtrue) { + sqlrcur->substitution(STR2CSTR(variable), + NUM2INT(value)); +@@ -1197,9 +1206,11 @@ static VALUE sqlrcur_inputBinds(int argc + } + if (rb_obj_is_instance_of(value,rb_cString)==Qtrue) { + sqlrcur->inputBind(STR2CSTR(variable),STR2CSTR(value)); +- } else if (rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || ++ } else if (rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#ifndef RUBY_INTEGER_UNIFICATION ++ rb_obj_is_instance_of(value,rb_cBignum)==Qtrue || + rb_obj_is_instance_of(value,rb_cFixnum)==Qtrue || +- rb_obj_is_instance_of(value,rb_cInteger)==Qtrue || ++#endif + rb_obj_is_instance_of(value,rb_cNumeric)==Qtrue) { + sqlrcur->inputBind(STR2CSTR(variable),NUM2INT(value)); + } else if (rb_obj_is_instance_of(value,rb_cFloat)==Qtrue) { |