]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commit
tools: avoid redefinition of typedefs
authorIan Campbell <ian.campbell@citrix.com>
Mon, 25 Jan 2016 15:29:21 +0000 (15:29 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 25 Jan 2016 15:45:52 +0000 (15:45 +0000)
commit84e0616a50f3799cdd5ae41e40b236390cb6b860
tree7c270dba946469a726c25aee84c4bd69df6cf5e5
parentd322b7f4c28ac5733a02a2d1ce64dbc8bc1f30b2
tools: avoid redefinition of typedefs

When splitting out various functionality from libxc into tools/libs/*
I attempted to make it possible to avoid callers being unnecessarily
exposed to the xentoollog interface by providing a typedef of the
xentoollog_logger handle in each of the headers.

However such typedefs are not allowed in C, instead it is necessary to
forward declare the struct and then use the struct xentoollog_logger
variant in the prototypes.

It appears that older gcc (e.g. 4.4) complains about this issue while
newer ones (e.g. 4.9) are more tolerant unless -pedantic-errors is
used, this was a deliberate change
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ce3765bf44e49ef0568a1ad4a0b7f807591d6412

As well as tools/libs/* it is also now necessary to give libvchan the
same treatment, since it previously inhereted the typedef via one of
tools/libs/*.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libs/call/include/xencall.h
tools/libs/evtchn/include/xenevtchn.h
tools/libs/foreignmemory/include/xenforeignmemory.h
tools/libs/gnttab/include/xengnttab.h
tools/libvchan/init.c
tools/libvchan/libxenvchan.h