[Libosinfo] [PATCH] Fix build with older GCC
Roman Bogorodskiy
bogorodskiy at gmail.com
Thu Mar 3 14:07:08 UTC 2016
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;
> --
> 2.4.6
>
Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20160303/9d2b86ba/attachment.sig>
More information about the Libosinfo
mailing list