Hi All,

Please test updates related to unification of redefinition of {v}snprintf.
Attached patches are against current master branch:
- 0001-minimize-use-of-HAVE_CONFIG_H-as-build-process-for-s.patch
The patch remove #Ifdef HAVE_CONFIG_H left only in regression test binaries.

- 0002-clean-redefinition-of-v-snprintf-in-C-source-as-thos.patch
Clean redefinition of {v}snprintf in C-source. This patch require above patch

Please could you test with MSC (Visual Studio):
- 2010 (own project build files )
- 2008 (custom makefile and configuration)
- earlier


Regards,
Roumen
From 12b513277972da70d52920f40381fc862366573e Mon Sep 17 00:00:00 2001
From: Roumen Petrov <[email protected]>
Date: Thu, 24 May 2012 00:47:06 +0300
Subject: [PATCH 1/2] minimize use of HAVE_CONFIG_H as build process for supported platforms provide "config.h" header file

---
 libxml.h                    |    5 +++++
 runsuite.c                  |    3 ---
 runtest.c                   |    3 ---
 runxmlconf.c                |    3 ---
 testapi.c                   |    3 ---
 testrecurse.c               |    3 ---
 win32/VC10/runsuite.vcxproj |    2 +-
 7 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/libxml.h b/libxml.h
index fa3aea4..efe285b 100644
--- a/libxml.h
+++ b/libxml.h
@@ -29,6 +29,11 @@
 #include <win32config.h>
 #include <libxml/xmlversion.h>
 #else
+/*
+ * Currently supported platforms use either autoconf or
+ * copy to config.h own "preset" configuration file.
+ * As result ifdef HAVE_CONFIG_H is omited here.
+ */
 #include "config.h"
 #include <libxml/xmlversion.h>
 #endif
diff --git a/runsuite.c b/runsuite.c
index d1dc2ca..8ba5f6f 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -6,11 +6,8 @@
  * [email protected]
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #include <unistd.h>
diff --git a/runtest.c b/runtest.c
index dd74c88..75ff3c2 100644
--- a/runtest.c
+++ b/runtest.c
@@ -11,11 +11,8 @@
  * [email protected]
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #include <unistd.h>
diff --git a/runxmlconf.c b/runxmlconf.c
index 52d50d7..a271343 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -6,11 +6,8 @@
  * [email protected]
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #ifdef LIBXML_XPATH_ENABLED
 
diff --git a/testapi.c b/testapi.c
index 4f4b39b..ad04e2c 100644
--- a/testapi.c
+++ b/testapi.c
@@ -8,11 +8,8 @@
  * [email protected]
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #include <stdlib.h> /* for putenv() */
 #include <string.h>
diff --git a/testrecurse.c b/testrecurse.c
index bdc7c30..6416b2a 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -10,11 +10,8 @@
  * [email protected]
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #include <unistd.h>
diff --git a/win32/VC10/runsuite.vcxproj b/win32/VC10/runsuite.vcxproj
index b4ccc37..83cc991 100644
--- a/win32/VC10/runsuite.vcxproj
+++ b/win32/VC10/runsuite.vcxproj
@@ -46,7 +46,7 @@
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\..\include;$(ProjectDir)..\..\..\libiconv-1.14.vc10\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <DisableSpecificWarnings>4996</DisableSpecificWarnings>
-      <PreprocessorDefinitions>HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <MinimalRebuild>false</MinimalRebuild>
     </ClCompile>
-- 
1.6.4

>From b54b6afe93fd914406dc1be89f449341018b455f Mon Sep 17 00:00:00 2001
From: Roumen Petrov <[email protected]>
Date: Thu, 24 May 2012 01:24:51 +0300
Subject: [PATCH 2/2] clean redefinition of {v}snprintf in C-source as those from *config.h are preferable

---
 python/libxml.c |    4 +---
 runsuite.c      |    4 ----
 runtest.c       |    4 ----
 runxmlconf.c    |    4 ----
 testapi.c       |    3 ---
 testrecurse.c   |    4 ----
 6 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/python/libxml.c b/python/libxml.c
index 9dabf89..ea4998b 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -28,9 +28,7 @@
 #include "libxml_wrap.h"
 #include "libxml2-py.h"
 
-#if defined(_MSC_VER) && !defined(vsnprintf)
-#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
-#elif defined(WITH_TRIO) && !defined(vsnprintf)
+#if defined(WITH_TRIO)
 #include "trio.h"
 #define vsnprintf trio_vsnprintf
 #endif
diff --git a/runsuite.c b/runsuite.c
index 8ba5f6f..c13189f 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -35,10 +35,6 @@
 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 75ff3c2..3bec092 100644
--- a/runtest.c
+++ b/runtest.c
@@ -192,10 +192,6 @@ static void globfree(glob_t *pglob) {
     }
 }
 
-#if !defined(__MINGW32__)
-#define vsnprintf _vsnprintf
-#define snprintf _snprintf
-#endif
 #else
 #include <glob.h>
 #endif
diff --git a/runxmlconf.c b/runxmlconf.c
index a271343..389c5d7 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -34,10 +34,6 @@ 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 ad04e2c..0126866 100644
--- a/testapi.c
+++ b/testapi.c
@@ -16,9 +16,6 @@
 #include <libxml/xmlerror.h>
 #include <libxml/relaxng.h>
 
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
-#define snprintf _snprintf
-#endif
 
 static int testlibxml2(void);
 static int test_module(const char *module);
diff --git a/testrecurse.c b/testrecurse.c
index 6416b2a..59f4576 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -146,10 +146,6 @@ static void globfree(glob_t *pglob) {
     }
 }
 
-#if !defined(__MINGW32__)
-#define vsnprintf _vsnprintf
-#define snprintf _snprintf
-#endif
 #else
 #include <glob.h>
 #endif
-- 
1.6.4

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to