On 16/3/23 08:13, Markus Armbruster wrote:
Positive test case
{ 'enum': 'TestIfEnum',
'data': [ 'foo', { 'name' : 'bar', 'if': 'TEST_IF_ENUM_BAR' } ],
'if': 'TEST_IF_ENUM' }
generates
#if defined(TEST_IF_ENUM)
typedef enum TestIfEnum {
TEST_IF_ENUM_FOO,
#if defined(TEST_IF_ENUM_BAR)
TEST_IF_ENUM_BAR,
#endif /* defined(TEST_IF_ENUM_BAR) */
TEST_IF_ENUM__MAX,
} TestIfEnum;
Macro TEST_IF_ENUM_BAR clashes with the enumeration constant.
Wouldn't compile with -DTEST_IF_BAR.
Rename the macro to TEST_IF_ENUM_MEMBER. For consistency, rename
similar macros elsewhere as well.
Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
tests/qapi-schema/qapi-schema-test.json | 12 ++++++------
tests/qapi-schema/qapi-schema-test.out | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>