[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 24/54] qapi-event: add #if conditions to events
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v2 24/54] qapi-event: add #if conditions to events |
Date: |
Tue, 22 Aug 2017 15:22:25 +0200 |
Wrap generated code with #if/#endif using the ifcond_decorator.
Signed-off-by: Marc-André Lureau <address@hidden>
---
scripts/qapi-event.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index fec27fe2e1..f21ecd39f3 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -152,6 +152,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
self.decl = None
self.defn = None
self._event_names = None
+ self.if_members = ['decl', 'defn']
def visit_begin(self, schema):
self.decl = ''
@@ -163,6 +164,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor):
self.defn += gen_enum_lookup(event_enum_name, self._event_names)
self._event_names = None
+ @ifcond_decorator
def visit_event(self, name, info, arg_type, boxed, ifcond):
self.decl += gen_event_send_decl(name, arg_type, boxed)
self.defn += gen_event_send(name, arg_type, boxed)
--
2.14.1.146.gd35faa819
- [Qemu-devel] [PATCH v2 15/54] qapi: add 'if' to top-level expressions, (continued)
- [Qemu-devel] [PATCH v2 15/54] qapi: add 'if' to top-level expressions, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 36/54] qapi: add #if conditions to generated variants, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 28/54] qapi: do not define enumeration value explicitely, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 34/54] qapi: add #if conditions to generated struct members, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 20/54] qapi-introspect: modify to_qlit() to take an optional suffix, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 18/54] qapi: add 'ifcond' to visitor methods, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 39/54] qapi: add #if conditions to generated alternate variants, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 10/54] block: use qemu_enum_parse() in blkdebug_debug_breakpoint, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 24/54] qapi-event: add #if conditions to events,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v2 14/54] qapi2texi: minor python code simplification, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 03/54] qobject: add literal qobject type, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 02/54] qdict: add qdict_put_null() helper, Marc-André Lureau, 2017/08/22
- [Qemu-devel] [PATCH v2 37/54] qapi: 'if' to alternate variant, Marc-André Lureau, 2017/08/22