[libxml2] More changes for Win32 compilation



commit e02869807eea99ded75d389855699e86f0c8d7d5
Author: Eric Zurcher <Eric Zurcher csiro au>
Date:   Wed Aug 15 16:30:10 2012 +1000

    More changes for Win32 compilation

 testlimits.c          |   27 ++++++---------------------
 win32/Makefile.msvc   |    3 ++-
 win32/libxml2.def.src |   22 ++++++++++++----------
 3 files changed, 20 insertions(+), 32 deletions(-)
---
diff --git a/testlimits.c b/testlimits.c
index 72392a0..f6c043e 100644
--- a/testlimits.c
+++ b/testlimits.c
@@ -23,7 +23,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/time.h>
+#include <time.h>
 
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
@@ -42,35 +42,20 @@ static int tests_quiet = 0;
  *									*
  ************************************************************************/
 
-/* maximum time for one parsing befor declaring a timeout */
+/* maximum time for one parsing before declaring a timeout */
 #define MAX_TIME 2 /* seconds */
 
-struct timeval t0;
-struct timeval tnow;
+static clock_t t0;
 int timeout = 0;
 
 static void reset_timout(void) {
     timeout = 0;
-    gettimeofday(&t0, NULL);
-}
-
-static unsigned long delta_timeval(void) {
-    unsigned long ret;
-
-    if (tnow.tv_usec < t0.tv_usec) {
-        ret = 1000000 + tnow.tv_usec;
-        ret -= t0.tv_usec;
-        ret += (tnow.tv_sec - t0.tv_sec -1) * 1000000;
-    } else {
-        ret = tnow.tv_usec - t0.tv_usec;
-        ret += (tnow.tv_sec - t0.tv_sec) * 1000000;
-    }
-    return(ret);
+    t0 = clock();
 }
 
 static int check_time(void) {
-    gettimeofday(&tnow, NULL);
-    if (delta_timeval() > MAX_TIME * 1000000) {
+    clock_t tnow = clock();
+    if (((tnow - t0) / CLOCKS_PER_SEC) > MAX_TIME) {
         timeout = 1;
         return(0);
     }
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index c5ab375..d917541 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -262,7 +262,8 @@ UTILS = $(BINDIR)\xmllint.exe\
 	$(BINDIR)\testXPath.exe\
 	$(BINDIR)\runtest.exe\
 	$(BINDIR)\runsuite.exe\
-	$(BINDIR)\testapi.exe
+	$(BINDIR)\testapi.exe\
+	$(BINDIR)\testlimits.exe
 	
 !if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
 UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src
index ce3f24a..4b85fc1 100644
--- a/win32/libxml2.def.src
+++ b/win32/libxml2.def.src
@@ -553,6 +553,11 @@ xmlAutomataSetFinalState
 #ifdef LIBXML_DEBUG_ENABLED
 xmlBoolToText
 #endif
+xmlBufContent
+xmlBufEnd
+xmlBufGetNodeContent
+xmlBufNodeDump
+xmlBufUse
 xmlBufferAdd
 xmlBufferAddHead
 xmlBufferCCat
@@ -561,6 +566,7 @@ xmlBufferContent
 xmlBufferCreate
 xmlBufferCreateSize
 xmlBufferCreateStatic
+xmlBufferDetach
 xmlBufferDump
 xmlBufferEmpty
 xmlBufferFree
@@ -765,10 +771,12 @@ xmlDictCreate
 xmlDictCreateSub
 xmlDictExists
 xmlDictFree
+xmlDictGetUsage
 xmlDictLookup
 xmlDictOwns
 xmlDictQLookup
 xmlDictReference
+xmlDictSetLimit
 xmlDictSize
 xmlDllMain
 xmlDocCopyNode
@@ -992,6 +1000,7 @@ xmlInitThreads
 #ifdef LIBXML_CATALOG_ENABLED
 xmlInitializeCatalog
 #endif
+xmlInitializeDict
 xmlInitializeGlobalState
 xmlInitializePredefinedEntities
 xmlIsBaseChar
@@ -1292,6 +1301,8 @@ xmlOutputBufferCreateFilename
 xmlOutputBufferCreateFilenameDefault
 xmlOutputBufferCreateIO
 xmlOutputBufferFlush
+xmlOutputBufferGetContent
+xmlOutputBufferGetSize
 xmlOutputBufferWrite
 xmlOutputBufferWriteEscape
 xmlOutputBufferWriteString
@@ -1590,22 +1601,12 @@ xmlSAXParseMemoryWithData
 xmlSAXUserParseFile
 xmlSAXUserParseMemory
 xmlSAXVersion
-xmlSaveClose
-xmlSaveDoc
 xmlSaveFile
 xmlSaveFileEnc
 xmlSaveFileTo
-xmlSaveFlush
 xmlSaveFormatFile
 xmlSaveFormatFileEnc
 xmlSaveFormatFileTo
-xmlSaveSetAttrEscape
-xmlSaveSetEscape
-xmlSaveToBuffer
-xmlSaveToFd
-xmlSaveToFilename
-xmlSaveToIO
-xmlSaveTree
 xmlSaveUri
 xmlScanName
 #ifdef LIBXML_SCHEMAS_ENABLED
@@ -1960,6 +1961,7 @@ xmlTextReaderRelaxNGSetSchema
 #ifdef LIBXML_SCHEMAS_ENABLED
 xmlTextReaderRelaxNGValidate
 #endif
+xmlTextReaderRelaxNGValidateCtxt
 xmlTextReaderSchemaValidate
 xmlTextReaderSchemaValidateCtxt
 xmlTextReaderSetErrorHandler



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