Bug 37443

Summary: compile errors on RHEL in display/gnome-rr.c
Product: Spice Reporter: David Jaša <jasa.david>
Component: spice-gtkAssignee: Spice Bug List <spice-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: full ./configure and make output
display: fix build error GLib <2.26

Description David Jaša 2011-05-21 13:06:39 UTC
Created attachment 46980 [details]
full ./configure and make output

SSIA

see build log - there are too many errors in the output to post them here.

Versions:
gcc-4.4.5-6.el6.x86_64
pygtk2-devel-2.16.0-3.el6.x86_64
intltool-0.41.0-1.1.el6.noarch
celt051-devel-0.5.1.3-0.el6.x86_64
gtk2-devel-2.18.9-6.el6.x86_64
openssl-devel-1.0.0-10.el6.x86_64
pixman-devel-0.18.4-1.el6_0.1.x86_64
python-2.6.6-20.el6.x86_64
spice-protocol from git
Comment 1 Christophe Fergeau 2011-05-23 01:34:05 UTC
The first line on which the compiler chokes is
G_DEFINE_BOXED_TYPE (GnomeRRCrtc, gnome_rr_crtc, crtc_copy, crtc_free)

This was only added in glib 2.26, and RHEL6 has 2.22. We'll have to add some #ifndef G_DEFINE_BOXED_TYPE 
#define G_DEFINE_BOXED_TYPE <code from glib>
#endif
Comment 2 Marc-Andre Lureau 2011-05-23 01:46:48 UTC
Created attachment 47028 [details] [review]
display: fix build error GLib <2.26
Comment 3 Christophe Fergeau 2011-05-23 02:03:37 UTC
Review of attachment 47028 [details] [review]:

2 small questions, but all in all it looks good to me.

::: gtk/display/gnome-rr.c
@@ +76,3 @@
         G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gnome_rr_screen_initable_iface_init))
 
+#if !GLIB_CHECK_VERSION(2,26,0)

I have a slight preference for #ifndef G_DEFINE_BOXED_TYPE in case it ever becomes deprecated, or in case someone builds with glib 2.25.x, or stuff like that, but all of these things are really unlikely, so I'm fine with the GLIB_CHECK_VERSION too

@@ +542,3 @@
 				guint32       *config_timestamp_ret)
 {
+    GnomeRRScreenPrivate *priv G_GNUC_UNUSED;

I'm not sure why this change was needed? Is that something unwanted that crept in?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.