[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 14/51] qapi-event: add #if conditions to events
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v4 14/51] qapi-event: add #if conditions to events |
Date: |
Thu, 11 Jan 2018 22:32:13 +0100 |
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 dda496e824..bef301dfe9 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, ifcond, arg_type, boxed):
self.decl += gen_event_send_decl(name, arg_type, boxed)
self.defn += gen_event_send(name, arg_type, boxed)
--
2.16.0.rc1.1.gef27df75a1
- [Qemu-devel] [PATCH v4 04/51] qapi2texi: minor python code simplification, (continued)
- [Qemu-devel] [PATCH v4 04/51] qapi2texi: minor python code simplification, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 05/51] qapi: add 'if' to top-level expressions, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 06/51] qapi: pass 'if' condition into QAPISchemaEntity objects, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 07/51] qapi: leave the ifcond attribute undefined until check(), Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 08/51] qapi: add 'ifcond' to visitor methods, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 09/51] qapi: mcgen() shouldn't indent # lines, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 10/51] qapi: add #if/#endif helpers, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 11/51] qapi-introspect: modify to_qlit() to append ', ' on level > 0, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 12/51] qapi-introspect: add preprocessor conditions to generated QLit, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 13/51] qapi-commands: add #if conditions to commands, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 14/51] qapi-event: add #if conditions to events,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v4 15/51] qapi-types: refactor variants handling, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 16/51] qapi-types: add #if conditions to types & visitors, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 17/51] qapi: do not define enumeration value explicitely, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 18/51] qapi: rename QAPISchemaEnumType.values to .members, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 20/51] tests: modify visit_enum_type() in test-qapi to print members, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 19/51] qapi: change enum visitor to take QAPISchemaMember, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 22/51] qapi: add a dictionnary form with 'name' key for enum members, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 21/51] qapi: factor out check_known_keys(), Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 24/51] qapi-event: add 'if' condition to implicit event enum, Marc-André Lureau, 2018/01/11
- [Qemu-devel] [PATCH v4 23/51] qapi: add 'if' to enum members, Marc-André Lureau, 2018/01/11