[xml] MinGW fixes for 2.2.7

Date view Thread view Subject view Author view

From: Wayne Davison (wayned@users.sourceforge.net)
Date: Mon Nov 06 2000 - 02:18:01 EST


The addition of the external error-reporting variables in 2.2.7 broke the
linking of testHTML and testSAX against the *.dll version of libxml (when
building using the MinGW compiler for Win32). To fix it, I needed to add
"__declspec(dllimport)" to the external variables, but only when they are
included from code that is outside the DLL.

The solution is to define LIBXML_DLL_IMPORT as nothing when creating code
that goes in the DLL, and as the aforementioned incantation for library-
using code. I chose to put the empty define into "win32config.h" (which
was not being included by hash.c, so I fixed that), and to put the
conditional define of the magic version into xmlversion.h[.in] (which was
included by all the macro-using .h headers through their direct/indirect
inclusion of tree.h).

I think I found and changed all external variable references in the .h
files. (I also eliminated the word "extern" from a few function
prototypes in xmlmemory.h, just for consistency's sake.)

Because the files testHTML.c and testSAX.c include both the win32config.h
include and expect to link with the DLL, I had to manually undefine the
LIBXML_DLL_IMPORT macro. Normal code that uses the DLL won't have
included win32config.h, so this shouldn't be a problem.

The patch is appended.

..wayne..


----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Nov 06 2000 - 02:46:02 EST