[libxml2] Restore code for Windows compilation



commit 22030ef8888579b9ae8d8a63367e31b201eef4b5
Author: Daniel Veillard <veillard redhat com>
Date:   Wed May 23 15:52:45 2012 +0800

    Restore code for Windows compilation
    
    Try to keep as close to rc1 but still allow the change from Roumen for
    mingw

 python/libxml.c |    4 +++-
 runsuite.c      |    4 ++++
 runtest.c       |    5 +++++
 runxmlconf.c    |    4 ++++
 testapi.c       |    2 +-
 testrecurse.c   |    5 +++++
 6 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/python/libxml.c b/python/libxml.c
index ea4998b..9dabf89 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -28,7 +28,9 @@
 #include "libxml_wrap.h"
 #include "libxml2-py.h"
 
-#if defined(WITH_TRIO)
+#if defined(_MSC_VER) && !defined(vsnprintf)
+#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
+#elif defined(WITH_TRIO) && !defined(vsnprintf)
 #include "trio.h"
 #define vsnprintf trio_vsnprintf
 #endif
diff --git a/runsuite.c b/runsuite.c
index c630767..d1dc2ca 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -38,6 +38,10 @@
 static FILE *logfile = NULL;
 static int verbose = 0;
 
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#endif
 
 /************************************************************************
  *									*
diff --git a/runtest.c b/runtest.c
index ff78f02..dd74c88 100644
--- a/runtest.c
+++ b/runtest.c
@@ -194,6 +194,11 @@ static void globfree(glob_t *pglob) {
              free(pglob->gl_pathv[i]);
     }
 }
+
+#if !defined(__MINGW32__)
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#endif
 #else
 #include <glob.h>
 #endif
diff --git a/runxmlconf.c b/runxmlconf.c
index a50021e..52d50d7 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -37,6 +37,10 @@ static int verbose = 0;
 
 #define NB_EXPECTED_ERRORS 15
 
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#endif
 
 const char *skipped_tests[] = {
 /* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */
diff --git a/testapi.c b/testapi.c
index 31ddd3d..c029d0b 100644
--- a/testapi.c
+++ b/testapi.c
@@ -19,7 +19,7 @@
 #include <libxml/xmlerror.h>
 #include <libxml/relaxng.h>
 
-#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
 #define snprintf _snprintf
 #endif
 
diff --git a/testrecurse.c b/testrecurse.c
index 3a52e26..bdc7c30 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -148,6 +148,11 @@ static void globfree(glob_t *pglob) {
              free(pglob->gl_pathv[i]);
     }
 }
+
+#if !defined(__MINGW32__)
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#endif
 #else
 #include <glob.h>
 #endif



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