[Libosinfo] [PATCH] Fix build with older GCC
Daniel P. Berrange
berrange at redhat.com
Thu Mar 3 14:18:57 UTC 2016
On Thu, Mar 03, 2016 at 05:07:08PM +0300, Roman Bogorodskiy wrote:
> Roman Bogorodskiy wrote:
>
> > Build with older gcc fails with:
> >
> > CC libosinfo_1_0_la-osinfo_avatar_format.lo
> > In file included from ../osinfo/osinfo_os.h:30,
> > from ../osinfo/osinfo.h:55,
> > from osinfo_avatar_format.c:28:
> > ../osinfo/osinfo_media.h:68: error: redefinition of typedef 'OsinfoMedia'
> > ../osinfo/osinfo_install_script.h:43: error: previous declaration of 'OsinfoMedia' was here
> >
> > To avoid redefinition, use forward-declaration in a similar way
> > like it's done for OsinfoOs in osinfo/osinfo_os.h.
>
> ping
>
> > ---
> > osinfo/osinfo_media.h | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/osinfo/osinfo_media.h b/osinfo/osinfo_media.h
> > index 8ad39c4..09fbacd 100644
> > --- a/osinfo/osinfo_media.h
> > +++ b/osinfo/osinfo_media.h
> > @@ -65,8 +65,11 @@ typedef enum {
> > #define OSINFO_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSINFO_TYPE_MEDIA))
> > #define OSINFO_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OSINFO_TYPE_MEDIA, OsinfoMediaClass))
> >
> > -typedef struct _OsinfoMedia OsinfoMedia;
> > -
> > +/*
> > + * Forward declared in osinfo_install_script.h
> > + *
> > + * typedef struct _OsinfoMedia OsinfoMedia;
> > + */
> > typedef struct _OsinfoMediaClass OsinfoMediaClass;
> >
> > typedef struct _OsinfoMediaPrivate OsinfoMediaPrivate;
ACK & pushed
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the Libosinfo
mailing list