(Have to apologize for not building on Windows *before* the 2.9.0 release came out... >_<)

Building 2.9.0 on MSVC7.1 currently fails with

        cl.exe /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS"  /D "NOLIBTOOL" /W1 /MD /I.. /I..\include 
/IC:\teragram\libxml2\include /D "_REENTRANT" /D "HAVE_WIN32_THREADS" /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /D 
"NDEBUG" /O2 /Foint.utils.msvc\ /c ..\testlimits.c
testlimits.c
        link.exe /nologo /VERSION:2.9 /LIBPATH:bin.msvc 
/LIBPATH:C:\teragram\libxml2\lib /OUT:bin.msvc\testlimits.exe libxml2.lib 
wsock32.lib ws2_32.lib kernel32.lib int.utils.msvc\testlimits.obj
testlimits.obj : error LNK2019: unresolved external symbol _vsnprintf 
referenced in function _channel
bin.msvc\testlimits.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.


This is because HAVE_CONFIG_H is not #defined, which is odd, because configure.js goes to the trouble of creating a config.h file.

An MSVC6 build fails with the following additional error:

timsort.h(75) : error C2059: syntax error : 'bad suffix on number'
timsort.h(75) : error C2146: syntax error : missing ')' before identifier 'L'
timsort.h(75) : error C2059: syntax error : ')'


(I.e. the compiler doesn't recognize the "ULL" integer-type suffix.)

The attached patch addresses the above, adds testrecurse.exe and the standard "make check" suite of tests to the MSVC makefile, and also fixes the following (MSVC7.1) warnings:

buf.c(674) : warning C4028: formal parameter 1 different from declaration
libxml2\timsort.h(71) : warning C4028: formal parameter 1 different from 
declaration


--Daniel


--
Daniel Richard G. || [email protected] || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index da12daa..7e06686 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -118,7 +118,7 @@ typedef xmlBuf *xmlBufPtr;
  */
 XMLPUBFUN xmlChar* XMLCALL       xmlBufContent	(const xmlBufPtr buf);
 XMLPUBFUN xmlChar* XMLCALL       xmlBufEnd      (const xmlBufPtr buf);
-XMLPUBFUN size_t XMLCALL         xmlBufUse      (xmlBufPtr buf);
+XMLPUBFUN size_t XMLCALL         xmlBufUse      (const xmlBufPtr buf);
 XMLPUBFUN size_t XMLCALL         xmlBufShrink	(xmlBufPtr buf, size_t len);
 
 /*
diff --git a/timsort.h b/timsort.h
index 95f412b..b3a32f0 100644
--- a/timsort.h
+++ b/timsort.h
@@ -30,6 +30,14 @@ typedef unsigned __int64 uint64_t;
 #endif
 #endif
 
+#ifndef MK_UINT64
+#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
+#define MK_UINT64(x) ((uint64_t)(x))
+#else
+#define MK_UINT64(x) x##ULL
+#endif
+#endif
+
 #ifndef MAX
 #define MAX(x,y) (((x) > (y) ? (x) : (y)))
 #endif
@@ -67,12 +75,12 @@ int clzll(uint64_t x) /* {{{ */
 #endif
 #endif
 
-int compute_minrun(const uint64_t size) /* {{{ */
+int compute_minrun(uint64_t size) /* {{{ */
 {
   const int top_bit = 64 - CLZ(size);
   const int shift = MAX(top_bit, 6) - 6;
   const int minrun = size >> shift;
-  const uint64_t mask = (1ULL << shift) - 1;
+  const uint64_t mask = (MK_UINT64(1) << shift) - 1;
   if (mask & size) return minrun + 1;
   return minrun;
 }
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index d917541..2b3d544 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -43,7 +43,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
 
 # The compiler and its options.
 CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS"  /D "NOLIBTOOL" /W1 $(CRUNTIME)
+CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_CONFIG_H" /D "NOLIBTOOL" /W1 $(CRUNTIME)
 CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
 !if "$(WITH_THREADS)" != "no"
 CFLAGS = $(CFLAGS) /D "_REENTRANT"
@@ -263,7 +263,8 @@ UTILS = $(BINDIR)\xmllint.exe\
 	$(BINDIR)\runtest.exe\
 	$(BINDIR)\runsuite.exe\
 	$(BINDIR)\testapi.exe\
-	$(BINDIR)\testlimits.exe
+	$(BINDIR)\testlimits.exe\
+	$(BINDIR)\testrecurse.exe
 	
 !if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
 UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
@@ -416,7 +417,15 @@ $(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
 
 # TESTS
 
-tests :  XPathtests
+tests : checktests XPathtests
+
+checktests : $(UTILS)
+	cd .. && win32\$(BINDIR)\runtest.exe
+	cd .. && win32\$(BINDIR)\testrecurse.exe
+	cd .. && win32\$(BINDIR)\testapi.exe
+	cd .. && win32\$(BINDIR)\testchar.exe
+	cd .. && win32\$(BINDIR)\testdict.exe
+	cd .. && win32\$(BINDIR)\runxmlconf.exe
 
 XPathtests : $(BINDIR)\testXPath.exe
 	@echo. 2> .memdump
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to