RE: [xml] minor libxml2-2.2.5 glitches

Date view Thread view Subject view Author view

From: Leo Davidson (leo@ox.compsoc.net)
Date: Mon Oct 16 2000 - 05:48:50 EDT


> I grabbed the libxml2-2.2.5 tar file from the gnome ftp server, and I
> encountered a problem building it using the MinGW build
> environment

2.2.5 doesn't seem to work out-of-the-box for MSVC++6, either. (But a huge
thank-you to Daniel for aiming to do this! The effort and difficulty is very
much appreciated given that the Windows platform is so different and lacking
in places.)

I should point out that I've only just started looking at LibXml (I wish I
had found it before Xerces-C) and that I have very little experience with
things like the build-configuration scripts which I don't think I can run on
Windows. (I think I understand what they do, though. :)) I apologise in
advance for my ignorance and anything stupid that I say!

> I had to edit include/win32config.h to add this line:
>
> #define SOCKLEN_T size_t
>
> I'm not sure if other Win32 build environments have this
> problem or not.

I also had errors because of this when I initally tried to build.

> One other thing I noticed:
>
> There's an extra copy of config.h and acconfig.h in the include/libxml
> dir, so I removed them both just to be sure that they weren't
> causing any
> problems. You might want to change the tar-building rules to avoid
> putting these files in there.

config.h and acconfig.h don't seem to make a difference for me, but as I say
I don't have a good understanding of the configuration stuff.

Additional comments about building on VC6:

As well as SOCKLEN_T being undefined, as mentioned above, I had errors
because iconv.h could not be found. I'll admit my ignorance again and say
that I don't know what iconv is but I saw in previous posts that LibXml has
been compiled with VC6 by disabling most of the optional stuff, so I edited
include/libxml/xmlversion.h and changed all of the "#if 1" lines to "#if 0",
which is fine for me as I'm just using XML as my configuration file format.

Having done this I only get two problems:

(One)

parserinternals.c(1032) : warning C4018: '>' : signed/unsigned mismatch

I'll just ignore the warning for now. I think it's because "used" is not
explicitly unsigned:
    int used;
    ...
    if (in->buf->buffer->use > used + 2 * INPUT_CHUNK)

(Two)

xmlio.c(1509) : warning C4013: 'getcwd' undefined; assuming extern returning
int
(This causes a third knock-on error because of the assumed return type.)

Adding "#include <direct.h>" to the top of xmlio.c fixed this.

Another Windows thing:

In xmlmemory.h:
typedef void *(*xmlMallocFunc)(int);
typedef void *(*xmlReallocFunc)(void *, int);

This causes a minor problem on VC6 since Malloc and Realloc take size_t,
defined as unsigned int, rather than int. (Of course, int is signed by
default, else there would not be a problem.) A simple cast when calling
xmlMemSetup gets around this but I thought I would mention it. (BTW, many
thanks for the well thought-out way this is done to avoid problems with the
library using incompatible memory functions!)

        Leo

----
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 Oct 16 2000 - 09:43:24 EDT