Re: [xml] Release candidate 2 of libxml2 2.8.0



On Wed, May 23, 2012 at 01:43:49AM +0300, Roumen Petrov wrote:
Hi All,

I think that I understand MSC build issue.


Michael Ludwig wrote:
Rob Richards schrieb am 21.05.2012 um 05:48 (-0400):
The mingw change for Bug 676427 ends up breaking for windows VS builds
as the change affects them and not just mingw. Basically by remove the
definitions, I end up with a bunch of unresolved external symbol
errors.

The configure.js create  config.h from win32config.h but
win32/Makefile* files does not define HAVE_CONFIG_H in CFLAGS. I
don't know why.

All source files except :
- runsuite.c
- runtest.c
- runxmlconf.c
- testapi.c
- testrecurse.c
include libxml.h unconditionally .

Above listed five (5) files use:
-----
#ifdef HAVE_CONFIG_H
#include "libxml.h"
#else
#include <stdio.h>
#endif
-----

So proposed fix is to replace just with
-----
#include "libxml.h"
#include <stdio.h>
-----
Note without to use #define IN_LIBXML before #include libxml.h

  That's probably the way to go, but IMHO we should do this after the
release of 2.8.0

FWIW, the link error I'm seeing is:

link.exe /nologo /VERSION:2.8 /LIBPATH:bin.msvc /LIBPATH:C:\Opt\CLib\LibXML\lib /OUT:bin.msvc\runtest.exe 
libxml2.lib  wsock32.lib ws2_32.lib iconv.lib kernel32.lib int.utils.msvc\runtest.obj
runtest.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_snprintf" in Funktion 
"_resultFilename".

Michael

Second solutions it to restore redefinition {v}snprintf  to
_{v}snprintf but with different rule . For instance following code:
-----
#if defined(_WIN32) && !defined(__CYGWIN__)
#define snprintf _snprintf
.....
#endif
-----
to be replaced by
++++
#if defined(_MSC_VER)
#define snprintf _snprintf
.....
#endif
++++

  I'm tempted to do this for the release but even more conservative
just make sure the redefinition of snprintf/vsnprintf is not done
if __MINGW32__ is defined.
  Just a temporary way to be as close to rc1 as possible but still
keep your change for Mingw. I'm doing this right now to try to get the
release out today.

Third solution is to update win32/Makefile* to define HAVE_CONFIG_H
in CFLAGS.
Note that win32/VC10/runsuite.vcxproj list HAVE_CONFIG_H in
<PreprocessorDefinitions> tag.

  I would rather keep the changes in the code if we can find a central
place rather than tweaking every possible combination of Makefiles

P.S. I forgot to update testapi.c so I will provide  additional
patch depending from feedback to address in addition testapi.c.

  okay, thanks

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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