Received: from eggs.gnu.org ([2001:4830:134:3::10]:46320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoDhi-0008Bu-Ul for qemu-devel@nongnu.org; Sun, 16 Jun 2013 10:13:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoDhf-0007aF-OP for qemu-devel@nongnu.org; Sun, 16 Jun 2013 10:13:14 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:33132 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoDhf-0007a6-IQ for qemu-devel@nongnu.org; Sun, 16 Jun 2013 10:13:11 -0400 From: Stefan Weil Date: Sun, 16 Jun 2013 16:13:07 +0200 Message-Id: <1371391987-10795-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] gtk: Fix compiler warning (GTK 3 deprecated function) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Stefan Weil , qemu-devel With GTK 3, the function gdk_cursor_unref is deprecated: qemu/ui/gtk.c: In function =E2=80=98gd_cursor_define=E2=80=99: qemu/ui/gtk.c:380:5: error: =E2=80=98gdk_cursor_unref=E2=80=99 is deprecated (declared at /usr/inclu= de/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=3D= deprecated-declarations] Fix the gcc compiler warning by using conditional compilation. Signed-off-by: Stefan Weil --- ui/gtk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index 50a6993..7310e20 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -377,7 +377,11 @@ static void gd_cursor_define(DisplayChangeListener *= dcl, pixbuf, c->hot_x, c->hot_y); gdk_window_set_cursor(gtk_widget_get_window(s->drawing_area), cursor= ); g_object_unref(pixbuf); +#if !GTK_CHECK_VERSION(3, 0, 0) gdk_cursor_unref(cursor); +#else + g_object_unref(cursor); +#endif } =20 static void gd_switch(DisplayChangeListener *dcl, --=20 1.7.10.4