[DRE-commits] [ruby-multimap] 01/03: Added patch for Ruby 2.2 (Closes: #791781)

Jonas Genannt genannt at moszumanska.debian.org
Sun Aug 16 18:40:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

genannt pushed a commit to branch master
in repository ruby-multimap.

commit 2c8362deca0a9a9275c0deb13dc5be0465a4d0d3
Author: Jonas Genannt <jonas at brachium-system.net>
Date:   Sun Aug 16 20:42:03 2015 +0200

    Added patch for Ruby 2.2 (Closes: #791781)
---
 debian/patches/ruby22.patch | 34 ++++++++++++++++++++++++++++++++++
 debian/patches/series       |  1 +
 2 files changed, 35 insertions(+)

diff --git a/debian/patches/ruby22.patch b/debian/patches/ruby22.patch
new file mode 100644
index 0000000..81a4b40
--- /dev/null
+++ b/debian/patches/ruby22.patch
@@ -0,0 +1,34 @@
+From ee464be3d02c424970a29e39002ec7a8decc2721 Mon Sep 17 00:00:00 2001
+From: Adam Palmblad <adam.palmblad at teampages.com>
+Date: Tue, 6 Jan 2015 19:28:14 -0800
+Subject: [PATCH] multimap would not compile in ruby 2.2
+
+Per https://github.com/ruby/ruby/commit/8250aa2df0d6b4dcfa11dbad5307d28c2d5dd85f, RHASH is no longer provided by ruby.h.  Looks like multimap just needed an RHASH_IFNONE check anyways, so I've replaced it with that macro, which is available, and defined it to what it was prior to ruby 2.2 if it is not available.
+
+Note that RHASH_IFNONE is deprecated, so this is just kicking the can
+down the road a bit.
+---
+ ext/nested_multimap_ext.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/ext/nested_multimap_ext.c b/ext/nested_multimap_ext.c
+index 9f42615..30910a6 100644
+--- a/ext/nested_multimap_ext.c
++++ b/ext/nested_multimap_ext.c
+@@ -1,4 +1,7 @@
+ #include "ruby.h"
++#ifndef RHASH_IFNONE
++#define HASH_IFNONE (RHASH(h)->ifnone)
++#endif
+ 
+ VALUE cNestedMultimap;
+ 
+@@ -10,7 +13,7 @@ static VALUE rb_nested_multimap_aref(int argc, VALUE *argv, VALUE self)
+ 	for (i = 0, r = self; rb_obj_is_kind_of(r, cNestedMultimap) == Qtrue; i++) {
+ 		h = rb_funcall(r, rb_intern("_internal_hash"), 0);
+ 		Check_Type(h, T_HASH);
+-		r = (i < argc) ? rb_hash_aref(h, argv[i]) : RHASH(h)->ifnone;
++		r = (i < argc) ? rb_hash_aref(h, argv[i]) : RHASH_IFNONE(h);
+ 	}
+ 
+ 	return r;
diff --git a/debian/patches/series b/debian/patches/series
index 0b18170..0466ddd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fixnum_string.patch
 fix_syntax_for_shared_examples.patch
+ruby22.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-multimap.git



More information about the Pkg-ruby-extras-commits mailing list