Menu

Constants Clash

Developer
Dave Cross
2007-05-17
2013-05-20
  • Dave Cross

    Dave Cross - 2007-05-17

    Hi,

    I've found that UNKNOWN is defined in 'Microsoft Visual Studio\VC98\CRT\SRC\ERRMSG.H' and clases with the enum in TinyXML.H.

    I have changed the enum to the following:
    enum NodeType
    {
      TIXML_DOCUMENT,
      TIXML_ELEMENT,
      TIXML_COMMENT,
      TIXML_UNKNOWN,
      TIXML_TEXT,
      TIXML_DECLARATION,
      TIXML_TYPECOUNT
    };
    which is more in keeping with the rest of the code anyway.

    Is this the appropriate place to suggest these changes be adopted in to the mainstream code base?

    Dave.

     
    • Lee Thomason

      Lee Thomason - 2007-05-19

      That's a good catch. I don't like to change the API, generally, but to not have a prefix (or namespace) around something like "DOCUMENT" is flat-out wrong. I'm surprised no one has complained before.

      I changed it in the (local) code. The change will be in the next version.

      lee

       
    • Lee Thomason

      Lee Thomason - 2007-05-19

      Ack, sorry wrote too quickly. The constants are scoped to TiXmlNode...so that is a bug in ERRMSG.H, not TinyXML. Still, the enum isn't exposed publicly, so it is a safe change.

      lee

       

Log in to post a comment.