qapi: add 'if' to top-level expressions
Accept 'if' key in top-level elements, accepted as string or list of string type. The following patches will modify the test visitor to check the value is correctly saved, and generate #if/#endif code (as a single #if/endif line or a series for a list). Example of 'if' key: { 'struct': 'TestIfStruct', 'data': { 'foo': 'int' }, 'if': 'defined(TEST_IF_STRUCT)' } The generated code is for now *unconditional*. Later patches generate the conditionals. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20180703155648.11933-2-marcandre.lureau@redhat.com> [Commit message and Documentation improved] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Showing
tests/qapi-schema/bad-if-list.err
0 → 100644
tests/qapi-schema/bad-if-list.out
0 → 100644
tests/qapi-schema/bad-if.err
0 → 100644
tests/qapi-schema/bad-if.exit
0 → 100644
tests/qapi-schema/bad-if.json
0 → 100644
tests/qapi-schema/bad-if.out
0 → 100644
想要评论请 注册 或 登录