On 2 February 2016 at 14:51, Eric Blake <ebl...@redhat.com> wrote: > Commit 86f4b687 broke compilation on MIPS, which has a preprocessor > pollution of '#define mips 1'. Treat it the same way as we do for > the pollution with 'unix', so that QMP remains backwards compatible > and only the C code needs to use the alternative 'q_mips' spelling. > > CC: James Hogan <james.ho...@imgtec.com> > Signed-off-by: Eric Blake <ebl...@redhat.com> > --- > scripts/qapi.py | 2 +- > cpus.c | 4 ++-- > hmp.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/scripts/qapi.py b/scripts/qapi.py > index d199222..7f114c4 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -1482,7 +1482,7 @@ def c_name(name, protect=True): > 'and', 'and_eq', 'bitand', 'bitor', 'compl', 'not', > 'not_eq', 'or', 'or_eq', 'xor', 'xor_eq']) > # namespace pollution: > - polluted_words = set(['unix', 'errno']) > + polluted_words = set(['unix', 'errno', 'mips']) > name = name.translate(c_name_trans) > if protect and (name in c89_words | c99_words | c11_words | gcc_words > | cpp_words | polluted_words):
Looking at commit 86f4b687 I think we also need to add 'sparc' to the polluted_words list (Solaris defines that). I would also be unsurprised to find that some PPC platforms define 'ppc'. (Tricore is probably new enough to have escaped this namespace pollution and we don't support it as a host CPU anyway.) thanks -- PMM