From patchwork Sun Jun 16 14:13:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 251683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7D22B2C013D for ; Mon, 17 Jun 2013 00:13:32 +1000 (EST) Received: from localhost ([::1]:38042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoDhw-0008CA-Q2 for incoming@patchwork.ozlabs.org; Sun, 16 Jun 2013 10:13:28 -0400 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 Received: by v2201305906712890.yourvserver.net (Postfix, from userid 1000) id 2A16D1828E7; Sun, 16 Jun 2013 16:13:08 +0200 (CEST) From: Stefan Weil To: Anthony Liguori Date: Sun, 16 Jun 2013 16:13:07 +0200 Message-Id: <1371391987-10795-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 37.221.198.45 Cc: Stefan Weil , qemu-devel Subject: [Qemu-devel] [PATCH] gtk: Fix compiler warning (GTK 3 deprecated function) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With GTK 3, the function gdk_cursor_unref is deprecated: qemu/ui/gtk.c: In function ‘gd_cursor_define’: qemu/ui/gtk.c:380:5: error: ‘gdk_cursor_unref’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=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 } static void gd_switch(DisplayChangeListener *dcl,