Patchwork ui/gtk: fix gtk KEY definition incompatiable

login
register
mail settings
Submitter liguang
Date Feb. 27, 2013, 6:35 a.m.
Message ID <1361946914-7712-1-git-send-email-lig.fnst@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/223513/
State New
Headers show

Comments

liguang - Feb. 27, 2013, 6:35 a.m.
fix build errors like following:

  CC    ui/gtk.o
In file included from /usr/include/gtk-2.0/gtk/gtk.h:233,
                 from ui/gtk.c:43:
ui/gtk.c: In function ‘gd_vc_init’:
ui/gtk.c:928: error: ‘GDK_KEY_2’ undeclared (first use in this function)
ui/gtk.c:928: error: (Each undeclared identifier is reported only once
ui/gtk.c:928: error: for each function it appears in.)
ui/gtk.c: In function ‘gd_create_menus’:
ui/gtk.c:1078: error: ‘GDK_KEY_f’ undeclared (first use in this function)
ui/gtk.c:1087: error: ‘GDK_KEY_plus’ undeclared (first use in this function)
ui/gtk.c:1093: error: ‘GDK_KEY_minus’ undeclared (first use in this function)
ui/gtk.c:1099: error: ‘GDK_KEY_0’ undeclared (first use in this function)
ui/gtk.c:1114: error: ‘GDK_KEY_g’ undeclared (first use in this function)
ui/gtk.c:1124: error: ‘GDK_KEY_1’ undeclared (first use in this function)

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 ui/gtk.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
Stefan Weil - Feb. 27, 2013, 3:51 p.m.
Am 27.02.2013 07:35, schrieb liguang:
> fix build errors like following:
>
>   CC    ui/gtk.o
> In file included from /usr/include/gtk-2.0/gtk/gtk.h:233,
>                  from ui/gtk.c:43:
> ui/gtk.c: In function ‘gd_vc_init’:
> ui/gtk.c:928: error: ‘GDK_KEY_2’ undeclared (first use in this function)
> ui/gtk.c:928: error: (Each undeclared identifier is reported only once
> ui/gtk.c:928: error: for each function it appears in.)
> ui/gtk.c: In function ‘gd_create_menus’:
> ui/gtk.c:1078: error: ‘GDK_KEY_f’ undeclared (first use in this function)
> ui/gtk.c:1087: error: ‘GDK_KEY_plus’ undeclared (first use in this function)
> ui/gtk.c:1093: error: ‘GDK_KEY_minus’ undeclared (first use in this function)
> ui/gtk.c:1099: error: ‘GDK_KEY_0’ undeclared (first use in this function)
> ui/gtk.c:1114: error: ‘GDK_KEY_g’ undeclared (first use in this function)
> ui/gtk.c:1124: error: ‘GDK_KEY_1’ undeclared (first use in this function)
>
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
>  ui/gtk.c |   29 +++++++++++++++++++++++++++++
>  1 files changed, 29 insertions(+), 0 deletions(-)

These build errors were already fixed in latest QEMU.

Kind regards,

Stefan Weil

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index dcce36d..69454ce 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -74,6 +74,35 @@ 
 
 #define MAX_VCS 10
 
+#ifndef GDK_KEY_0
+#define GDK_KEY_0 GDK_0
+#endif
+
+#ifndef GDK_KEY_1
+#define GDK_KEY_1 GDK_1
+#endif
+
+#ifndef GDK_KEY_2
+#define GDK_KEY_2 GDK_2
+#endif
+
+#ifndef GDK_KEY_f
+#define GDK_KEY_f GDK_f
+#endif
+
+#ifndef GDK_KEY_g
+#define GDK_KEY_g GDK_g
+#endif
+
+#ifndef GDK_KEY_plus
+#define GDK_KEY_plus GDK_plus
+#endif
+
+#ifndef GDK_KEY_minus
+#define GDK_KEY_minus GDK_minus
+#endif
+
+
 typedef struct VirtualConsole
 {
     GtkWidget *menu_item;