]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Complete the change in vasnprintf.c from 2010-04-10.
authorBruno Haible <bruno@clisp.org>
Thu, 7 Jul 2011 10:48:38 +0000 (12:48 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 7 Jul 2011 10:49:27 +0000 (12:49 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/printf.c

index faa63636b199dac0c98d3464d471a28d8a8a78b3..e65acd26980d6b56a2c9dfb5a0bd52e4d1769c30 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-07  Bruno Haible  <bruno@clisp.org>
+
+       Complete the change in vasnprintf.c from 2010-04-10.
+       * printf.c (system_vsnprintf) [mingw]: Prefer vsnprintf over
+       _vsnprintf.
+
 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
 
        * verify.h (verify_true): Deprecate.
index 40ce7eefeae016cf6680508974a292d7fddde106..157853ad4c441865e6832e50d4d1e61780946a45 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings, using POSIX/XSI format strings with positions.
-   Copyright (C) 2003, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2011 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -191,8 +191,13 @@ libintl_sprintf (char *resultbuf, const char *format, ...)
 #if HAVE_SNPRINTF
 
 # if HAVE_DECL__SNPRINTF
-   /* Windows.  */
-#  define system_vsnprintf _vsnprintf
+   /* Windows.  The mingw function vsnprintf() has fewer bugs than the MSVCRT
+      function _vsnprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define system_vsnprintf vsnprintf
+#  else
+#   define system_vsnprintf _vsnprintf
+#  endif
 # else
    /* Unix.  */
 #  define system_vsnprintf vsnprintf
@@ -302,7 +307,8 @@ libintl_asprintf (char **resultp, const char *format, ...)
 #endif
 
 # if HAVE_DECL__SNWPRINTF
-   /* Windows.  */
+   /* Windows.  The function vswprintf() has a different signature than
+      on Unix; we use the function _vsnwprintf() instead.  */
 #  define system_vswprintf _vsnwprintf
 # else
    /* Unix.  */