[Expat-discuss] API change seems necessary for 1.95.8

Karl Waclawek karl at waclawek.net
Mon Mar 15 10:26:37 EST 2004


In the (not yet officially released) suspend/resume API for Expat 1.95.8
I ran into a portability problem. It seems that the handling
of return values is not well-defined and very compiler specific
even between compilers on Windows/Intel. Specifically:

XMLPARSEAPI(XML_ParsingStatus)
XML_GetParsingStatus(XML_Parser parser);

returns a struct larger than 4 bytes.
As far as I can tell, the usual calling conventions (cdecl, stdcall, etc.)
do not have a definition for how return values are be handled, especially for
anything larger than an integer. MS VC++ uses the EDX:EAX register pair
for an 8 byte struct, Delphi uses a pointer passed as first parameter
(both having cdecl specified!).

So, in the interest of portability I would like to change
the signature above to:

XMLPARSEAPI(void)
XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus * status);

Any objections? Is this a common or well known problem?

Karl






More information about the Expat-discuss mailing list