From f8abb8e483b4fa66b199e8c05f88e6c241380bc2 Mon Sep 17 00:00:00 2001 From: Pablo Brasero Date: Wed, 26 Jun 2013 20:47:55 +0100 Subject: [PATCH 1/2] This does the trick on Ruby 2.0 on Linux --- ext/bzip2/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/bzip2/common.h b/ext/bzip2/common.h index 5a99b75..e14da94 100644 --- a/ext/bzip2/common.h +++ b/ext/bzip2/common.h @@ -6,7 +6,7 @@ #ifndef RUBY_19_COMPATIBILITY # include -# include +//# include #else # include #endif From 5edc9672faabe89cc2edea850b99704344bc2845 Mon Sep 17 00:00:00 2001 From: Michael Rykov Date: Fri, 31 Jan 2014 13:48:26 -0800 Subject: [PATCH 2/2] Use RBASIC_SET_CLASS for Ruby 2.1 compatibility --- ext/bzip2/writer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/bzip2/writer.c b/ext/bzip2/writer.c index 6c999ea..44b5cd4 100644 --- a/ext/bzip2/writer.c +++ b/ext/bzip2/writer.c @@ -163,7 +163,12 @@ VALUE bz_writer_close(VALUE obj) { res = bz_writer_internal_close(bzf); #ifndef RUBINIUS if (!NIL_P(res) && (bzf->flags & BZ2_RB_INTERNAL)) { +#ifdef RBASIC_CLASS + RBASIC_SET_CLASS(res, rb_cString); +#endif +#ifndef RBASIC_CLASS RBASIC(res)->klass = rb_cString; +#endif } #endif return res;