mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 22:25:27 +00:00
qapi/common: Fix guardname() for funny filenames
guardname() fails to return a valid C identifier for arguments containing anything but [A-Za-z0-9_.-']. Fix that. Don't bother protecting ticklish identifiers; header guards are all-caps, and no ticklish identifiers are. Backports commit f9c146399dabefb8cd13c9c467a9e710af15ea70 from qemu
This commit is contained in:
parent
1fb1d31a1f
commit
c18d107804
|
@ -1876,7 +1876,7 @@ def mcgen(code, **kwds):
|
|||
|
||||
|
||||
def guardname(filename):
|
||||
return c_name(filename, protect=False).upper()
|
||||
return re.sub(r'[^A-Za-z0-9_]', '_', filename).upper()
|
||||
|
||||
|
||||
def guardstart(name):
|
||||
|
|
Loading…
Reference in a new issue