]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
vasnprintf: Fix multiple test failures on mingw.
authorBruno Haible <bruno@clisp.org>
Sat, 10 Apr 2010 20:47:14 +0000 (22:47 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Apr 2010 14:05:50 +0000 (16:05 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/vasnprintf.c
gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/vasnprintf.c

index e51c8409721ac59a20d2a8b1f6fcca11c3c21a29..516952d6043d9e8b1f54b11735f13b87839a2eea 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-10  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf: Fix multiple test failures on mingw.
+       * vasnprintf.c (SNPRINTF) [mingw]: Define to snprintf, not _snprintf,
+       or snwprintf, not _snwprintf.
+
 2010-03-25  Bruno Haible  <bruno@clisp.org>
 
        Minor formatting changes.
index 295dbc46b438664f7c004ae0be75d3a06e03b62e..11d92b4e1f1c1a6cc3ac2baf9cadabe033edf0b9 100644 (file)
 # define USE_SNPRINTF 1
 # if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
-      on Unix; we use the _snwprintf() function instead.  */
-#  define SNPRINTF _snwprintf
+      on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+      instead.  The mingw function snwprintf() has fewer bugs than the
+      MSVCRT function _snwprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snwprintf
+#  else
+#   define SNPRINTF _snwprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF swprintf
 #  define USE_SNPRINTF 0
 # endif
 # if HAVE_DECL__SNPRINTF
-   /* Windows.  */
-#  define SNPRINTF _snprintf
+   /* Windows.  The mingw function snprintf() has fewer bugs than the MSVCRT
+      function _snprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snprintf
+    /* Here we need to call the native snprintf, not rpl_snprintf.  */
+#   undef snprintf
+#  else
+#   define SNPRINTF _snprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF snprintf
index 79761d2573ca3f7a1084ab30b73a9128e6d3998b..65f315cb453d3e072fae49568c04800ccbb188ce 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-10  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf: Fix multiple test failures on mingw.
+       * vasnprintf.c (SNPRINTF) [mingw]: Define to snprintf, not _snprintf,
+       or snwprintf, not _snwprintf.
+
 2010-01-01  Bruno Haible  <bruno@clisp.org>
 
        * vasnprintf.c (VASNPRINTF): If GNULIB_defined_mbstate_t is defined,
index 295dbc46b438664f7c004ae0be75d3a06e03b62e..11d92b4e1f1c1a6cc3ac2baf9cadabe033edf0b9 100644 (file)
 # define USE_SNPRINTF 1
 # if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
-      on Unix; we use the _snwprintf() function instead.  */
-#  define SNPRINTF _snwprintf
+      on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+      instead.  The mingw function snwprintf() has fewer bugs than the
+      MSVCRT function _snwprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snwprintf
+#  else
+#   define SNPRINTF _snwprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF swprintf
 #  define USE_SNPRINTF 0
 # endif
 # if HAVE_DECL__SNPRINTF
-   /* Windows.  */
-#  define SNPRINTF _snprintf
+   /* Windows.  The mingw function snprintf() has fewer bugs than the MSVCRT
+      function _snprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snprintf
+    /* Here we need to call the native snprintf, not rpl_snprintf.  */
+#   undef snprintf
+#  else
+#   define SNPRINTF _snprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF snprintf