Re: [xml] RE: [xslt] small fix needed for win32

Good Morning Ladies and Gentlemen, Boys and Girls.

  xmllint.c actually includes "libxml.h", but I din't changed that
in the last 2 months.
  If Igor could look at this and see if this or what need patching
that would be the best.

  Yes! Last time we discussed this topic, you sounded... well, a bit
oversensitive :-) I think it was due to stup... ehem... pressure in another,
unrelated post thread. With time, you got your new coffee machine and calmed
down, but I forgot to rise the topic again :-)

  It is not just xmllint, but also xsltproc and several other programs as
well. The fact is, IN_LIBXML must not be defined when compiling xmllint.
Xmlint is just like any other client program and if client code defines
IN_LIBXML, the build will fail. Either libxml.h must loose the line that
reads #define IN_LIBXML, or xmllint may never include this file. The same
goes for xsltproc and libxslt.
  Attached are patches for libxml2 and libxslt. With these, xmllint and
friends do not include internal headers anymore.

  Before these are applied however, I would like to point out that they are
wrong, in my opinion. Actually libxml.h should loose that #define IN_LIBXML
line, but somehow the tension was against that step when we discussed this
last time.
  Xmllint includes libxml.h internal header for easier cross-platform
compiling. Excluding it would force redefinition of many things in
xmllint.c, which are defined allready in libxml.h, or through libxml.h. This
is understandable and desirable.
  What I didn't understand back then, and still don't understand, why must
IN_LIBXML be manually defined in the internal header file? Why is defining
it on the compiler command line not sufficient? If its definition is removed
from libxml.h, xmllint can perfectly reuse libxml internal headers to
improve its own portability.
  As I see it, one of the following three must happen, in order of

  1. Remove lines like #define IN_LIBXML from whereever they appear. This
macro may only be defined on the compiler command line and the code may only
test if it is defined. This does not make libxml.h a public header, it just
enables the client code shipped with libxml2 to profit from the efforts made
to have libxml2 compile on so many platforms.
  2. Apply the attached patches. This will work and whatever the portability
issue was fixed in libxml.h, it must be fixed again in xmllint.c. Note that
all this holds for xsltproc/libxslt as well.
  3. Well, then I must make a patch here which does the 1) and apply it
locally every time I check out the code from the scratch. The binaries won't
change, but the source will not compile as is. Every now and then, someone
will ask this list why this is so and I shall put my finger before my lips
and say Sshhhhh... :-) :-)


Attachment: libxslt.diff
Description: Binary data

Attachment: libxml.diff
Description: Binary data

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