Re: [xml] Patches for Win32/MSCC build

Hi there,

The process to implement the Win32 DLL linkage is correct but the generated
DLL cannot be used by other compilers (like the Borland C++ Builder).

The reason is that all functions are exported according the MS name

One solution could be the usage of the  APIENTRY macro like the example:

BOOL APIENTRY xmlWriteDoc(xmlDocPtr doc,LPSTR FileName,int CompressLevel);



----- Original Message -----
From: "Igor Zlatkovic" <izlatkovic daenet de>
To: <xml gnome org>
Sent: sábado, 14 de abril de 2001 13:00
Subject: [xml] Patches for Win32/MSCC build

Hi there.

Here are few things regarding the Win32/MSCC build of libxml2. The patches
are made against libxml2-2.3.6.

1. MSVC project files are updated to contain newly made source files. The
project files are in the tarball named 'dspfiles.tar.gz', compressed in
order to avoid CRLF->LF conversion. These files must be in CRLF format,
because the Microsoft's IDE does not like it otherwise. All .dsp files
the tarball belong under win32/libxml2.

2. The file 'libxml2.def.src' is a pseudo-source file used to generate the
.DEF for the MS linker. The above project files assume it is there and
handle it properly without further intervention. It belongs under
win32/libxml2 as well. With this, we can finally make a usable shared
library under Win32/MSCC platform. The library exports 736 symbols and if
that isn't enough... I would like to thank everyone for ideas and thoughts
regarding this issue.

3. I made small change to include/libxml/xmlversion.h. Namely, this file
included by the above 'libxml2.def.src' and then preprocessed. After
preprocessing, a small piece of code remains in the generated .DEF file
MS linker feels slightly offended by that. The piece of code in question
a simple function prototype:

    extern void xmlCheckVersion(int version);

A small modification makes it conditional:

    extern void xmlCheckVersion(int version);

This 'LIBXML2_COMPILING_MSCCDEF' macro is defined in 'libxml2.def.src'.
Under all other platform/compiler combinations, it is always undefined.
patch can be found in xmlversion.diff

4. include/win32config.h now has the mappings for snprintf and vsnprintf,
which are present in Microsoft's C runtime under different names. The
is in win32config.diff

5. xmllint.c received a small modification which makes it compile and work
under Win32/MSCC correctly, with disabled timings. The patch is in

I wish you all a nice weekend

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]