Skip to content

Compiling error when macro defined #6

@Vanuan

Description

@Vanuan

I have a shema that includes enum values which has the same names as macro defines.

<xsd:simpleType name="ST_Example">
<xsd:restriction base="xsd:token">
  <xsd:enumeration value="macro1">
  </xsd:enumeration>
  <xsd:enumeration value="macro2">
  </xsd:enumeration>
  <xsd:enumeration value="macro3">
  </xsd:enumeration>
</xsd:restriction>
 </xsd:simpleType>

It generates to:

static const Enum MACRO1;
static const Enum MACRO2;
static const Enum MACRO3;

When compiler finds MACRO1 it substitutes it.

So, I have three options:
rename name in schema
rename macro
write #undef MACRO1 before variable declaration.

The best option, I think, is the third. How can I change generator, so it will add "#undef MACRO1" before "static const Enum MACRO1"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions