[packages/ruby] fix ruby.h header to allow !! which gcc 4.8 is unable to parse

glen glen at pld-linux.org
Sat Jul 26 21:27:18 CEST 2014


commit 4fe1ce27707b7bb185b0fb265a63816a8cc80b9b
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Jul 26 22:16:52 2014 +0300

    fix ruby.h header to allow !! which gcc 4.8 is unable to parse

 gcc-value.patch | 21 +++++++++++++++++++++
 ruby.spec       |  4 +++-
 2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/ruby.spec b/ruby.spec
index e2d4469..9e8936f 100644
--- a/ruby.spec
+++ b/ruby.spec
@@ -16,7 +16,7 @@
 %bcond_without	default_ruby	# use this Ruby as default system Ruby
 %bcond_with	bootstrap	# build bootstrap version
 
-%define		rel		1
+%define		rel		2
 %define		ruby_version	2.0
 %define		basever		2.0.0
 %define		patchlevel	481
@@ -71,6 +71,7 @@ Patch6:		DESTDIR.patch
 Patch7:		empty-ruby-version.patch
 Patch8:		rubygems-2.0.0-binary-extensions.patch
 Patch9:		custom-rubygems-location.patch
+Patch10:	gcc-value.patch
 URL:		http://www.ruby-lang.org/
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake
@@ -430,6 +431,7 @@ Biblioteka JSON dla języka Ruby.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 # must be regenerated with new bison
 %{__rm} parse.{c,h}
diff --git a/gcc-value.patch b/gcc-value.patch
new file mode 100644
index 0000000..f0dd9a6
--- /dev/null
+++ b/gcc-value.patch
@@ -0,0 +1,21 @@
+fix compiler (gcc 4.8) errors for ruby-gnome2:
+
+rbgtkcalendar.c: In function 'rg_display_options':
+/usr/include/ruby-2.0/ruby/ruby.h:446:18: error: expected '(' before '!' token
+ #define NIL_P(v) !((VALUE)(v) != Qnil)
+
+seems same error as here:
+https://github.com/shoes/shoes/issues/246
+--- ruby-2.0.0-p481/include/ruby/ruby.h~	2014-07-26 21:30:04.005696992 +0300
++++ ruby-2.0.0-p481/include/ruby/ruby.h	2014-07-26 21:30:11.189350307 +0300
+@@ -442,8 +442,8 @@
+ #endif
+ #define SYMBOL_FLAG RUBY_SYMBOL_FLAG
+ 
+-#define RTEST(v) !(((VALUE)(v) & ~Qnil) == 0)
+-#define NIL_P(v) !((VALUE)(v) != Qnil)
++#define RTEST(v) (!(((VALUE)(v) & ~Qnil) == 0))
++#define NIL_P(v) (!((VALUE)(v) != Qnil))
+ 
+ #define CLASS_OF(v) rb_class_of((VALUE)(v))
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby.git/commitdiff/4fe1ce27707b7bb185b0fb265a63816a8cc80b9b



More information about the pld-cvs-commit mailing list