]> git.pld-linux.org Git - packages/ruby-gnome2.git/commitdiff
fix parse error with NIL_P used without parenthesis auto/th/ruby-gnome2-1.1.9-1
authorElan Ruusamäe <glen@delfi.ee>
Sat, 26 Jul 2014 20:11:57 +0000 (23:11 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sat, 26 Jul 2014 20:11:57 +0000 (23:11 +0300)
NIL_P is defined without parenthesis and causes parse errors if
used in "if-statement"

parse-error.patch [new file with mode: 0644]
ruby-gnome2.spec

diff --git a/parse-error.patch b/parse-error.patch
new file mode 100644 (file)
index 0000000..f1d2ccd
--- /dev/null
@@ -0,0 +1,63 @@
+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-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgtkcalendar.c~       2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgtkcalendar.c        2014-07-26 22:30:31.050939929 +0300
+@@ -105,7 +105,7 @@
+     VALUE flags;
+     rb_scan_args(argc, argv, "01", &flags);
+-    if NIL_P(flags){
++    if (NIL_P(flags)){
+ #if GTK_CHECK_VERSION(2,4,0)
+         return GFLAGS2RVAL(gtk_calendar_get_display_options(_SELF(self)),
+                            GTK_TYPE_CALENDAR_DISPLAY_OPTIONS);
+--- ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkscreen.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkscreen.c  2014-07-26 22:30:54.818646494 +0300
+@@ -210,7 +210,7 @@
+     VALUE value;
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type))
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
+--- ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkevent.c~  2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gtk2/ext/gtk2/rbgdkevent.c   2014-07-26 22:31:06.012469585 +0300
+@@ -387,7 +387,7 @@
+     VALUE value;
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type))
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
+--- ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkscreen.c~ 2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkscreen.c  2014-07-26 22:31:15.812898377 +0300
+@@ -214,7 +214,7 @@
+     VALUE value;
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type))
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
+--- ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkevent.c~  2012-01-05 13:23:51.000000000 +0200
++++ ruby-gnome2-all-1.1.9/gdk3/ext/gdk3/rbgdkevent.c   2014-07-26 22:31:26.213353421 +0300
+@@ -370,7 +370,7 @@
+     VALUE value;
+     rb_scan_args(argc, argv, "11", &name, &type);
+-    if NIL_P(type) 
++    if (NIL_P(type))
+         gtype = G_TYPE_STRING;
+     else
+         gtype = CLASS2GTYPE(type);
index cbdba7f3f5a45cedfdf2c9daa6f43d6fd42b2fd4..e0fbb229b0409d0d5954d9aefc7e232fae5f67ad 100644 (file)
@@ -23,6 +23,7 @@ License:      LGPL v2.1
 Group:         Development/Languages
 Source0:       http://downloads.sourceforge.net/ruby-gnome2/%{name}-all-%{version}.tar.gz
 # Source0-md5: 852a528f8e58ca2729dada994c938be0
+Patch0:                parse-error.patch
 URL:           http://ruby-gnome2.sourceforge.jp/
 BuildRequires: atk-devel >= 1.0
 BuildRequires: cairo-devel >= 1.10.0
@@ -409,6 +410,7 @@ Przykłady do Ruby-GNOME2.
 %prep
 %setup -q -n %{name}-all-%{version}
 find . -name '*.rb' | xargs sed -i -e '1s,#.*local/bin/ruby,#!%{_bindir}/ruby,'
+%patch0 -p1
 
 cp -p glib2/README README.glib2
 cp -p glib2/TODO TODO.glib2
This page took 0.057809 seconds and 4 git commands to generate.