[Expat-checkins] expat/lib expat.h, 1.55, 1.56 xmlparse.c, 1.112, 1.113

Fred L. Drake fdrake at users.sourceforge.net
Wed Oct 15 16:51:31 EDT 2003


Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv10514

Modified Files:
	expat.h xmlparse.c 
Log Message:
clean up the macro restructuring, and make it play nice on Windows

Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- expat.h	15 Oct 2003 16:25:43 -0000	1.55
+++ expat.h	15 Oct 2003 20:51:28 -0000	1.56
@@ -20,7 +20,7 @@
 #define XML_USE_MSC_EXTENSIONS 1
 #endif
 
-/* Expat tries very hard to make the API buondary very specifically
+/* 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
@@ -63,15 +63,35 @@
 #endif  /* not defined XMLCALL */
 
 
-#if !defined(XMLIMPORT) && !defined(XML_STATIC)
+#if !defined(XML_STATIC) && !defined(XMLIMPORT)
+#ifdef XML_BUILDING_EXPAT
+/* we're actually building Expat itself */
+
+#if defined(__GNUC__)
+/* needed in a very obscure case according the the GCC documentation
+   (Windows NT on PowerPC) */
+#define XMLIMPORT __attribute__((dllexport))
+#endif
+
+#else
+/* using Expat from an application */
+
 #ifdef XML_USE_MSC_EXTENSIONS
 #define XMLIMPORT __declspec(dllimport)
+#elif defined(__GNUC__)
+/* needed in a very obscure case according the the GCC documentation
+   (Windows NT on PowerPC) */
+#define XMLIMPORT __attribute__((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
 

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- xmlparse.c	15 Oct 2003 16:25:43 -0000	1.112
+++ xmlparse.c	15 Oct 2003 20:51:28 -0000	1.113
@@ -5,26 +5,17 @@
 #include <stddef.h>
 #include <string.h>                     /* memset(), memcpy() */
 
-#ifdef COMPILED_FROM_DSP
+#define XML_BUILDING_EXPAT 1
 
+#ifdef COMPILED_FROM_DSP
 #include "winconfig.h"
-#define XMLPARSEAPI(type) type __cdecl
-#include "expat.h"
-
 #elif defined(MACOS_CLASSIC)
-
 #include "macconfig.h"
-#include "expat.h"
-
 #else
-
 #include <expat_config.h>
-
-#define XMLIMPORT
+#endif /* ndef COMPILED_FROM_DSP */
 
 #include "expat.h"
-
-#endif /* ndef COMPILED_FROM_DSP */
 
 #ifdef XML_UNICODE
 #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX





More information about the Expat-checkins mailing list