[Expat-checkins] expat/lib external.h, NONE, 1.1 expat.dsp, 1.10, 1.11 expat.h, 1.65, 1.66 expat_static.dsp, 1.2, 1.3 expatw.dsp, 1.3, 1.4 expatw_static.dsp, 1.2, 1.3 xmlparse.c, 1.129, 1.130 xmlrole.c, 1.16, 1.17 xmltok.c, 1.29, 1.30 xmltok.h, 1.9, 1.10

Karl Waclawek kwaclaw at users.sourceforge.net
Fri Mar 26 09:24:15 EST 2004


Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6105

Modified Files:
	expat.dsp expat.h expat_static.dsp expatw.dsp 
	expatw_static.dsp xmlparse.c xmlrole.c xmltok.c xmltok.h 
Added Files:
	external.h 
Log Message:
Fix for bug #923913, Calling convention problems.
For details see bug description.


--- NEW FILE: external.h ---
/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
   See the file COPYING for copying permission.
*/

/* External API definitions */

#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif

/* Expat tries very hard to make the API boundary very specifically
   defined.  There are two macros defined to control this boundary;
   each of these can be defined before including this header to
   achieve some different behavior, but doing so it not recommended or
   tested frequently.

   XMLCALL    - The calling convention to use for all calls across the
                "library boundary."  This will default to cdecl, and
                try really hard to tell the compiler that's what we
                want.

   XMLIMPORT  - Whatever magic is needed to note that a function is
                to be imported from a dynamically loaded library
                (.dll, .so, or .sl, depending on your platform).

   The XMLCALL macro was added in Expat 1.95.7.  The only one which is
   expected to be directly useful in client code is XMLCALL.

   Note that on at least some Unix versions, the Expat library must be
   compiled with the cdecl calling convention as the default since
   system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(XML_USE_MSC_EXTENSIONS)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
   one calling convention, we need to extend this definition to
   declare the convention used on that platform, if it's possible to
   do so.

   If this is the case for your platform, please file a bug report
   with information on how to identify your platform via the C
   pre-processor and how to specify the same calling convention as the
   platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif  /* not defined XMLCALL */


#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */

#ifdef XML_USE_MSC_EXTENSIONS
#define XMLIMPORT __declspec(dllimport)
#endif

#endif
#endif  /* not defined XML_STATIC */

/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif


#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL

#ifdef __cplusplus
extern "C" {
#endif

#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif

#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else                  /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */

Index: expat.dsp
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.dsp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- expat.dsp	15 Oct 2003 21:38:15 -0000	1.10
+++ expat.dsp	26 Mar 2004 14:24:09 -0000	1.11
@@ -133,10 +133,18 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\external.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\iasciitab.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\internal.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\latin1tab.h
 # End Source File
 # Begin Source File

Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- expat.h	16 Mar 2004 22:14:30 -0000	1.65
+++ expat.h	26 Mar 2004 14:24:09 -0000	1.66
@@ -15,97 +15,11 @@
 #endif
 
 #include <stdlib.h>
-
-#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
-#define XML_USE_MSC_EXTENSIONS 1
-#endif
-
-/* Expat tries very hard to make the API boundary very specifically
-   defined.  There are two macros defined to control this boundary;
-   each of these can be defined before including this header to
-   achieve some different behavior, but doing so it not recommended or
-   tested frequently.
-
-   XMLCALL    - The calling convention to use for all calls across the
-                "library boundary."  This will default to cdecl, and
-                try really hard to tell the compiler that's what we
-                want.
-
-   XMLIMPORT  - Whatever magic is needed to note that a function is
-                to be imported from a dynamically loaded library
-                (.dll, .so, or .sl, depending on your platform).
-
-   The XMLCALL macro was added in Expat 1.95.7.  The only one which is
-   expected to be directly useful in client code is XMLCALL.
-
-   Note that on at least some Unix versions, the Expat library must be
-   compiled with the cdecl calling convention as the default since
-   system headers may assume the cdecl convention.
-*/
-#ifndef XMLCALL
-#if defined(XML_USE_MSC_EXTENSIONS)
-#define XMLCALL __cdecl
-#elif defined(__GNUC__) && defined(__i386)
-#define XMLCALL __attribute__((cdecl))
-#else
-/* For any platform which uses this definition and supports more than
-   one calling convention, we need to extend this definition to
-   declare the convention used on that platform, if it's possible to
-   do so.
-
-   If this is the case for your platform, please file a bug report
-   with information on how to identify your platform via the C
-   pre-processor and how to specify the same calling convention as the
-   platform's malloc() implementation.
-*/
-#define XMLCALL
-#endif
-#endif  /* not defined XMLCALL */
-
-
-#if !defined(XML_STATIC) && !defined(XMLIMPORT)
-#ifndef XML_BUILDING_EXPAT
-/* using Expat from an application */
-
-#ifdef XML_USE_MSC_EXTENSIONS
-#define XMLIMPORT __declspec(dllimport)
-#endif
-
-#endif
-#endif  /* not defined XML_STATIC */
-
-/* If we didn't define it above, define it away: */
-#ifndef XMLIMPORT
-#define XMLIMPORT
-#endif
-
-
-#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef XML_UNICODE_WCHAR_T
-#define XML_UNICODE
-#endif
+#include "external.h"
 
 struct XML_ParserStruct;
 typedef struct XML_ParserStruct *XML_Parser;
 
-#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
-#ifdef XML_UNICODE_WCHAR_T
-typedef wchar_t XML_Char;
-typedef wchar_t XML_LChar;
-#else
-typedef unsigned short XML_Char;
-typedef char XML_LChar;
-#endif /* XML_UNICODE_WCHAR_T */
-#else                  /* Information is UTF-8 encoded. */
-typedef char XML_Char;
-typedef char XML_LChar;
-#endif /* XML_UNICODE */
-
 /* Should this be defined using stdbool.h when C99 is available? */
 typedef unsigned char XML_Bool;
 #define XML_TRUE   ((XML_Bool) 1)
@@ -265,9 +179,9 @@
 
 
 typedef struct {
-  void *(XMLCALL *malloc_fcn)(size_t size);
-  void *(XMLCALL *realloc_fcn)(void *ptr, size_t size);
-  void (XMLCALL *free_fcn)(void *ptr);
+  void *(*malloc_fcn)(size_t size);
+  void *(*realloc_fcn)(void *ptr, size_t size);
+  void (*free_fcn)(void *ptr);
 } XML_Memory_Handling_Suite;
 
 /* Constructs a new parser; encoding is the encoding specified by the

Index: expat_static.dsp
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat_static.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- expat_static.dsp	21 Oct 2002 21:19:41 -0000	1.2
+++ expat_static.dsp	26 Mar 2004 14:24:10 -0000	1.3
@@ -115,10 +115,18 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\external.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\iasciitab.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\internal.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\latin1tab.h
 # End Source File
 # Begin Source File

Index: expatw.dsp
===================================================================
RCS file: /cvsroot/expat/expat/lib/expatw.dsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- expatw.dsp	15 Oct 2003 21:38:15 -0000	1.3
+++ expatw.dsp	26 Mar 2004 14:24:10 -0000	1.4
@@ -134,10 +134,18 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\external.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\iasciitab.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\internal.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\latin1tab.h
 # End Source File
 # Begin Source File

Index: expatw_static.dsp
===================================================================
RCS file: /cvsroot/expat/expat/lib/expatw_static.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- expatw_static.dsp	21 Oct 2002 21:19:41 -0000	1.2
+++ expatw_static.dsp	26 Mar 2004 14:24:10 -0000	1.3
@@ -115,10 +115,18 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\external.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\iasciitab.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\internal.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\latin1tab.h
 # End Source File
 # Begin Source File

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- xmlparse.c	16 Mar 2004 22:14:31 -0000	1.129
+++ xmlparse.c	26 Mar 2004 14:24:10 -0000	1.130
@@ -491,7 +491,7 @@
   void *m_unknownEncodingMem;
   void *m_unknownEncodingData;
   void *m_unknownEncodingHandlerData;
-  void (*m_unknownEncodingRelease)(void *);
+  void (XMLCALL *m_unknownEncodingRelease)(void *);
   PROLOG_STATE m_prologState;
   Processor *m_processor;
   enum XML_Error m_errorCode;

Index: xmlrole.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlrole.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- xmlrole.c	13 Feb 2004 18:11:51 -0000	1.16
+++ xmlrole.c	26 Mar 2004 14:24:11 -0000	1.17
@@ -12,6 +12,7 @@
 #endif
 #endif /* ndef COMPILED_FROM_DSP */
 
+#include "external.h"
 #include "internal.h"
 #include "xmlrole.h"
 #include "ascii.h"

Index: xmltok.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- xmltok.c	16 Oct 2003 04:51:11 -0000	1.29
+++ xmltok.c	26 Mar 2004 14:24:11 -0000	1.30
@@ -12,6 +12,7 @@
 #endif
 #endif /* ndef COMPILED_FROM_DSP */
 
+#include "external.h"
 #include "internal.h"
 #include "xmltok.h"
 #include "nametab.h"
@@ -1233,7 +1234,7 @@
 
 struct unknown_encoding {
   struct normal_encoding normal;
-  int (*convert)(void *userData, const char *p);
+  CONVERTER convert;
   void *userData;
   unsigned short utf16[256];
   char utf8[256][4];

Index: xmltok.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmltok.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- xmltok.h	14 Dec 2002 03:12:18 -0000	1.9
+++ xmltok.h	26 Mar 2004 14:24:11 -0000	1.10
@@ -281,7 +281,8 @@
 int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
 int XmlSizeOfUnknownEncoding(void);
 
-typedef int (*CONVERTER)(void *userData, const char *p);
+
+typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
 
 ENCODING *
 XmlInitUnknownEncoding(void *mem,




More information about the Expat-checkins mailing list