mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
use mingw C99 compatible functions {v}snprintf instead those from MSVC runtime
This commit is contained in:
committed by
Daniel Veillard
parent
f27c6683e6
commit
978ff224b2
28
configure.in
28
configure.in
@ -1497,18 +1497,22 @@ AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
|
|||||||
AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
|
AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
|
||||||
|
|
||||||
dnl Checking the standard string functions availability
|
dnl Checking the standard string functions availability
|
||||||
case "$host" in
|
dnl
|
||||||
*-*-mingw*)
|
dnl Note mingw* has C99 implementation that produce expected xml numbers
|
||||||
AC_CHECK_FUNCS(printf sprintf fprintf _snprintf vfprintf vsprintf _vsnprintf sscanf,
|
dnl if code use {v}snprintf functions.
|
||||||
[AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
|
dnl If you like to activate at run-time C99 compatible number output
|
||||||
AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])],
|
dnl see release note for mingw runtime 3.15:
|
||||||
NEED_TRIO=1)
|
dnl http://sourceforge.net/project/shownotes.php?release_id=24832
|
||||||
;;
|
dnl
|
||||||
*)
|
dnl Also *win32*config.h files redefine them for various MSC compilers.
|
||||||
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
|
dnl
|
||||||
NEED_TRIO=1)
|
dnl So do not redefine {v}snprintf to _{v}snprintf like follwing:
|
||||||
;;
|
dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
|
||||||
esac
|
dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
|
||||||
|
dnl and do not redefine those functions is C-source files.
|
||||||
|
dnl
|
||||||
|
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
|
||||||
|
NEED_TRIO=1)
|
||||||
|
|
||||||
if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
|
if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
|
||||||
then
|
then
|
||||||
|
@ -28,9 +28,7 @@
|
|||||||
#include "libxml_wrap.h"
|
#include "libxml_wrap.h"
|
||||||
#include "libxml2-py.h"
|
#include "libxml2-py.h"
|
||||||
|
|
||||||
#if (defined(_MSC_VER) || defined(__MINGW32__)) && !defined(vsnprintf)
|
#if defined(WITH_TRIO)
|
||||||
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
|
||||||
#elif defined(WITH_TRIO) && !defined(vsnprintf)
|
|
||||||
#include "trio.h"
|
#include "trio.h"
|
||||||
#define vsnprintf trio_vsnprintf
|
#define vsnprintf trio_vsnprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,15 +39,6 @@ static FILE *logfile = NULL;
|
|||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
||||||
|
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
|
|
||||||
#define snprintf _snprintf
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* File name and path utilities *
|
* File name and path utilities *
|
||||||
|
@ -194,8 +194,6 @@ static void globfree(glob_t *pglob) {
|
|||||||
free(pglob->gl_pathv[i]);
|
free(pglob->gl_pathv[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#else
|
#else
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,13 +37,6 @@ static int verbose = 0;
|
|||||||
|
|
||||||
#define NB_EXPECTED_ERRORS 15
|
#define NB_EXPECTED_ERRORS 15
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
||||||
|
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
|
|
||||||
#define snprintf _snprintf
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const char *skipped_tests[] = {
|
const char *skipped_tests[] = {
|
||||||
/* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */
|
/* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */
|
||||||
|
@ -148,8 +148,6 @@ static void globfree(glob_t *pglob) {
|
|||||||
free(pglob->gl_pathv[i]);
|
free(pglob->gl_pathv[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
#define snprintf _snprintf
|
|
||||||
#else
|
#else
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user