On Di, 2015-05-26 at 08:35 +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > only). That, or pass -Wno-deprecated-declarations for compiling 
> > ui/gtk.c, but that seems very ugly to me.
> 
> We can also try some #pragma warn dance, to limit the
> -Wno-deprecated-declarations to a small code block.
> 
> We have something simliar already for a bug in the gtk2 headers.

i.e. like this:
>From 21b26f0f0bc57c209381fd13c7ca01ea97354dfc Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kra...@redhat.com>
Date: Tue, 26 May 2015 11:52:08 +0200
Subject: [PATCH] gtk: silence gtk_widget_set_double_buffered warning

Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
 ui/gtk.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ui/gtk.c b/ui/gtk.c
index 0b87aa6..126326a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1739,7 +1739,20 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
 
 #if defined(CONFIG_OPENGL)
     if (display_opengl) {
+        /*
+         * gtk_widget_set_double_buffered() was deprecated in 3.14.
+         * It is required for opengl rendering on X11 though.  A
+         * proper replacement (native opengl support) is only
+         * available in 3.16+.  Silence the warning if possible.
+         */
+#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
         gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE);
+#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
+#pragma GCC diagnostic pop
+#endif
         vc->gfx.dcl.ops = &dcl_egl_ops;
     } else
 #endif
-- 
1.8.3.1

Reply via email to