[libxml2] Fix mingw's snprintf configure check



commit fda5717c4d664fc67142b5f0e3e87f22ae046b8d
Author: Andoni Morales <ylatuya gmail com>
Date:   Tue May 8 10:46:09 2012 +0800

    Fix mingw's snprintf configure check
    
    For mingw, snprintf is defined as _snprintf and therefore the check
    should be for _snprintf. This applies to _vsnprintf too.

 configure.in |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/configure.in b/configure.in
index 8183860..5a6f5b7 100644
--- a/configure.in
+++ b/configure.in
@@ -510,10 +510,6 @@ AC_CHECK_FUNCS(strftime localtime gettimeofday ftime)
 AC_CHECK_FUNCS(stat _stat signal)
 AC_CHECK_FUNCS(rand srand time)
 
-dnl Checking the standard string functions availability
-AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
-               NEED_TRIO=1)
-
 dnl Checking for va_copy availability
 AC_MSG_CHECKING([for va_copy])
 AC_TRY_LINK([#include <stdarg.h>
@@ -1473,8 +1469,6 @@ case "$host" in
  WIN32_EXTRA_LIBADD="-lws2_32"
  WIN32_EXTRA_LDFLAGS="-no-undefined"
  AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
- AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
- AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
  if test "${PYTHON}" != ""
  then
    WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython${PYTHON_VERSION//./}"
@@ -1494,6 +1488,20 @@ AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD)
 AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
 AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
 
+dnl Checking the standard string functions availability
+case "$host" in
+ *-*-mingw*)
+ AC_CHECK_FUNCS(printf sprintf fprintf _snprintf vfprintf vsprintf _vsnprintf sscanf,
+               [AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
+                AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])],
+               NEED_TRIO=1)
+ ;;
+ *)
+ AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
+               NEED_TRIO=1)
+ ;;
+esac
+
 if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
 then
     echo Enabling code coverage for GCC



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