summary refs log tree commit diff stats
path: root/scripts/qapi/types.py
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-07-03 17:56:40 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-07-03 18:38:53 +0200
commitded9fc28b5a07213f3e5e8ac7ea0494b85813de1 (patch)
treeab324b1d74043c2481ffb5a7b3b3fb896d03c06e /scripts/qapi/types.py
parent485d948ce86f5a096dc848ec31b70cd66452d40d (diff)
downloadfocaccia-qemu-ded9fc28b5a07213f3e5e8ac7ea0494b85813de1.tar.gz
focaccia-qemu-ded9fc28b5a07213f3e5e8ac7ea0494b85813de1.zip
qapi: add #if/#endif helpers
Add helpers to wrap generated code with #if/#endif lines.

A later patch wants to use QAPIGen for generating C snippets rather
than full C files with copyright headers etc.  Splice in class
QAPIGenCCode between QAPIGen and QAPIGenC.

Add a 'with' statement context manager that will be used to wrap
generator visitor methods.  The manager will check if code was
generated before adding #if/#endif lines on QAPIGenCSnippet
objects. Used in the following patches.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180703155648.11933-7-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/types.py')
0 files changed, 0 insertions, 0 deletions