Marc-André Lureau <marcandre.lur...@redhat.com> writes: > Add 'if' c-preprocessor condition on top-level schema elements: > struct, enum, union, alternate, command, event. > > Variants objects types are created outside of #if blocks, since they > may be shared by various types. Even if unused, this shouldn't be an > issue, since those are internal types. > > Note that there is no checks in qapi scripts to verify that elements > have compatible conditions (ex: if-struct used by a if-foo > command). This may thus fail at C build time if they don't share the > same subset of conditions. > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > scripts/qapi.py | 153 > +++++++++++++++++++++++++------- > scripts/qapi-commands.py | 4 +- > scripts/qapi-event.py | 4 +- > scripts/qapi-introspect.py | 46 ++++++---- > scripts/qapi-types.py | 51 +++++++---- > scripts/qapi-visit.py | 13 ++- > scripts/qapi2texi.py | 10 +-- > tests/Makefile.include | 1 + > tests/qapi-schema/bad-if.err | 1 + > tests/qapi-schema/bad-if.exit | 1 + > tests/qapi-schema/bad-if.json | 3 + > tests/qapi-schema/bad-if.out | 0 > tests/qapi-schema/qapi-schema-test.json | 20 +++++ > tests/qapi-schema/qapi-schema-test.out | 31 +++++++ > tests/qapi-schema/test-qapi.py | 21 +++-- > 15 files changed, 272 insertions(+), 87 deletions(-) > create mode 100644 tests/qapi-schema/bad-if.err > create mode 100644 tests/qapi-schema/bad-if.exit > create mode 100644 tests/qapi-schema/bad-if.json > create mode 100644 tests/qapi-schema/bad-if.out
Missing: docs/devel/qapi-code-gen.txt update. [...]