[ expat-Patches-412076 ] Expat for Cygwin

noreply@sourceforge.net noreply@sourceforge.net
Fri, 25 May 2001 06:40:15 -0700


Patches item #412076, was updated on 2001-03-28 18:48
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=412076&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David Crowley (dcrowley)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Expat for Cygwin

Initial Comment:

Here's a diff I have for expat.h to compile with the 
Cygwin gcc compiler.



----------------------------------------------------------------------

Comment By: Robert Collins (rbcollins)
Date: 2001-05-25 06:40

Message:
Logged In: YES 
user_id=30963

Here's an alternative patch. I don't know which will be 
more msdev friendly... The need for the patch is that the 
macro XMPARSEAPI expands in the middle of the return value 
(ie gcc see
const char __declspec(dllimport) * function 
which is uhmmm, bad.
putting the XMLPARSEAPI at the end as per my patch gives
const char * __declspec(dllimport) function 
which is better, and shouldn't confuse MS compilers either.

Kudos for the nice fast package btw. 

Rob 
(Cygwin pthread maintainer)

--- expat-1.95.1/lib/expat.h	Mon Oct 23 06:47:35 2000
+++ expat-1.95.1-good/lib/expat.h	Fri May 25 23:30:05 
2001
@@ -544,7 +544,7 @@ Returns zero if out of memory, non-zero 
 int XMLPARSEAPI
 XML_SetBase(XML_Parser parser, const XML_Char *base);
 
-const XML_Char  XMLPARSEAPI *
+const XML_Char * XMLPARSEAPI 
 XML_GetBase(XML_Parser parser);
 
 /* Returns the number of the attribute/value pairs passed 
in last call
@@ -570,7 +570,7 @@ len may be zero for this call (or any ot
 int XMLPARSEAPI
 XML_Parse(XML_Parser parser, const char *s, int len, int 
isFinal);
 
-void XMLPARSEAPI *
+void * XMLPARSEAPI 
 XML_GetBuffer(XML_Parser parser, int len);
 
 int XMLPARSEAPI
@@ -683,7 +683,7 @@ XML_GetCurrentByteCount(XML_Parser parse
    NOTE: The character pointer returned should not be used 
outside
    the handler that makes the call. */
 
-const char XMLPARSEAPI *
+const char * XMLPARSEAPI 
 XML_GetInputContext(XML_Parser parser,
 		    int *offset,
 		    int *size);
@@ -698,11 +698,11 @@ void XMLPARSEAPI
 XML_ParserFree(XML_Parser parser);
 
 /* Returns a string describing the error. */
-const XML_LChar XMLPARSEAPI *
+const XML_LChar * XMLPARSEAPI 
 XML_ErrorString(int code);
 
 /* Return a string containing the version number of this 
expat */
-const XML_LChar XMLPARSEAPI *
+const XML_LChar * XMLPARSEAPI 
 XML_ExpatVersion();
 
 #ifdef __cplusplus


----------------------------------------------------------------------

Comment By: David Crowley (dcrowley)
Date: 2001-05-08 13:33

Message:
Logged In: YES 
user_id=27458

It looks like the Cygnus gcc-2.95.3-4 needs this patch.

----------------------------------------------------------------------

Comment By: David Crowley (dcrowley)
Date: 2001-03-29 10:43

Message:
Logged In: YES 
user_id=27458

Actually, the latest version of the Cygnus gcc compiler 
(gcc-2.95.3-1) doesn't need this patch.  An earlier version 
(I don't know exact version) did.  It was probably a bug in 
the compiler, it looks like it has something to do with the 
XMLPARSEAPI macro along with a const return value.  I just 
had to move the XMLPARSEAPI macro before the return type.


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-03-28 21:16

Message:
Logged In: YES 
user_id=3066

The diff is not attached; please use the SF page for this patch to attach the diff -- thanks!

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=310127&aid=412076&group_id=10127