qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/14] tests/qapi-schema: Rename a few conditionals


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 10/14] tests/qapi-schema: Rename a few conditionals
Date: Thu, 16 Mar 2023 08:45:28 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

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 <armbru@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é <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]