[Spice-devel] [PATCH spice-gtk 1/2] build-sys: fix compilation of bindings

Alon Levy alevy at redhat.com
Tue Mar 20 10:52:45 PDT 2012


On Tue, Mar 20, 2012 at 06:40:11PM +0100, Marc-André Lureau wrote:
> Hide symbol from API to fix pygobject.
> 
> Also vapigen chokes on "record" typename
> 
> SpiceClientGtk-3.0.gir:32.55-32.55: error: The type name `Gtk.BoxClass' could not be found <type name="Gtk.BoxClass" c:type="GtkBoxClass"/>
> 
> This seems to be a bug in symbol lookup in vapigen. Using a struct
> typedef solves it.

Well, if it works.. Although it sounds a bit magic. File a bug upstream?
(/me hides)

ACK both.

> ---
>  gtk/usb-device-widget.h |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/gtk/usb-device-widget.h b/gtk/usb-device-widget.h
> index b0513c4..3920990 100644
> --- a/gtk/usb-device-widget.h
> +++ b/gtk/usb-device-widget.h
> @@ -38,11 +38,11 @@ typedef struct _SpiceUsbDeviceWidgetClass SpiceUsbDeviceWidgetClass;
>  typedef struct _SpiceUsbDeviceWidgetPrivate SpiceUsbDeviceWidgetPrivate;
>  
>  #if GTK_CHECK_VERSION(3,0,0)
> -typedef GtkBox SpiceGtkBox;
> -typedef GtkBoxClass SpiceGtkBoxClass;
> +typedef struct _GtkBox _SpiceGtkBox;
> +typedef struct _GtkBoxClass _SpiceGtkBoxClass;
>  #else
> -typedef GtkVBox SpiceGtkBox;
> -typedef GtkVBoxClass SpiceGtkBoxClass;
> +typedef struct _GtkVBox _SpiceGtkBox;
> +typedef struct _GtkVBoxClass _SpiceGtkBoxClass;
>  #endif
>  
>  /**
> @@ -52,7 +52,7 @@ typedef GtkVBoxClass SpiceGtkBoxClass;
>   */
>  struct _SpiceUsbDeviceWidget
>  {
> -    SpiceGtkBox parent;
> +    _SpiceGtkBox parent;
>  
>      /*< private >*/
>      SpiceUsbDeviceWidgetPrivate *priv;
> @@ -67,7 +67,7 @@ struct _SpiceUsbDeviceWidget
>   */
>  struct _SpiceUsbDeviceWidgetClass
>  {
> -    SpiceGtkBoxClass parent_class;
> +    _SpiceGtkBoxClass parent_class;
>  
>      /* signals */
>      void (*connect_failed) (SpiceUsbDeviceWidget *widget,
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list