Ticket #220: expat-1.95.6-fix-declaration-order.patch

File expat-1.95.6-fix-declaration-order.patch, 2.6 KB (added by tushar@…, 19 years ago)

Fixes expat.h

  • lib/expat.h

    diff -ur expat-1.95.6.orig/lib/expat.h expat-1.95.6/lib/expat.h
    old new  
    647647/* Returns the last value set by XML_SetUserData or NULL. */
    648648#define XML_GetUserData(parser) (*(void **)(parser))
    649649
     650/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
     651   detected.  The last call to XML_Parse must have isFinal true; len
     652   may be zero for this call (or any other).
     653
     654   The XML_Status enum gives the possible return values for the
     655   XML_Parse and XML_ParseBuffer functions.  Though the return values
     656   for these functions has always been described as a Boolean value,
     657   the implementation, at least for the 1.95.x series, has always
     658   returned exactly one of these values.  The preprocessor #defines
     659   are included so this stanza can be added to code that still needs
     660   to support older versions of Expat 1.95.x:
     661
     662   #ifndef XML_STATUS_OK
     663   #define XML_STATUS_OK    1
     664   #define XML_STATUS_ERROR 0
     665   #endif
     666
     667   Otherwise, the #define hackery is quite ugly and would have been dropped.
     668*/
     669enum XML_Status {
     670  XML_STATUS_ERROR = 0,
     671#define XML_STATUS_ERROR XML_STATUS_ERROR
     672  XML_STATUS_OK = 1
     673#define XML_STATUS_OK XML_STATUS_OK
     674};
     675
    650676/* This is equivalent to supplying an encoding argument to
    651677   XML_ParserCreate. On success XML_SetEncoding returns non-zero,
    652678   zero otherwise.
     
    713739XMLPARSEAPI(int)
    714740XML_GetIdAttributeIndex(XML_Parser parser);
    715741
    716 /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
    717    detected.  The last call to XML_Parse must have isFinal true; len
    718    may be zero for this call (or any other).
    719 
    720    The XML_Status enum gives the possible return values for the
    721    XML_Parse and XML_ParseBuffer functions.  Though the return values
    722    for these functions has always been described as a Boolean value,
    723    the implementation, at least for the 1.95.x series, has always
    724    returned exactly one of these values.  The preprocessor #defines
    725    are included so this stanza can be added to code that still needs
    726    to support older versions of Expat 1.95.x:
    727 
    728    #ifndef XML_STATUS_OK
    729    #define XML_STATUS_OK    1
    730    #define XML_STATUS_ERROR 0
    731    #endif
    732 
    733    Otherwise, the #define hackery is quite ugly and would have been dropped.
    734 */
    735 enum XML_Status {
    736   XML_STATUS_ERROR = 0,
    737 #define XML_STATUS_ERROR XML_STATUS_ERROR
    738   XML_STATUS_OK = 1
    739 #define XML_STATUS_OK XML_STATUS_OK
    740 };
    741 
    742742XMLPARSEAPI(enum XML_Status)
    743743XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
    744744