mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 07:31:00 +00:00
qapi: Fix compilation failure on MIPS and SPARC
Commit 86f4b687 broke compilation on MIPS and SPARC, which have a preprocessor pollution of '#define mips 1' and '#define sparc 1', respectively. 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', 'q_sparc' spelling. Backports commit 86ae191163d48ff4ff9d9996868e6cfe92a82449 from qemu
This commit is contained in:
parent
49b8891872
commit
0c04f85d31
|
@ -1481,7 +1481,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', 'sparc'])
|
||||
name = name.translate(c_name_trans)
|
||||
if protect and (name in c89_words | c99_words | c11_words | gcc_words
|
||||
| cpp_words | polluted_words):
|
||||
|
|
Loading…
Reference in a new issue