Description: Supports __USE_MINGW_ANSI_STDIO
 Uses mingw64 notion of POSIX/gnuish/better stdio routines
 .
 mingw64-x-gettext (0.19.2-1) UNRELEASED; urgency=low
 .
   * New upstream release.
Author: Alexandre Pereira Nunes <alexandre.nunes@gmail.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

Index: gettext-0.19.2/gettext-runtime/libasprintf/vasnprintf.c
===================================================================
--- gettext-0.19.2.orig/gettext-runtime/libasprintf/vasnprintf.c
+++ gettext-0.19.2/gettext-runtime/libasprintf/vasnprintf.c
@@ -67,7 +67,15 @@
 #endif
 
 #include <locale.h>     /* localeconv() */
+#if defined(__MINGW64_VERSION_MAJOR) && defined(__USE_MINGW_ANSI_STDIO)
+#  define REMOVED__USE_MINGW_ANSI_STDIO __USE_MINGW_ANSI_STDIO
+#  undef __USE_MINGW_ANSI_STDIO
+#endif
 #include <stdio.h>      /* snprintf(), sprintf() */
+#if defined(__MINGW64_VERSION_MAJOR) && defined(REMOVED__USE_MINGW_ANSI_STDIO)
+#  define __USE_MINGW_ANSI_STDIO REMOVED__USE_MINGW_ANSI_STDIO
+#undef REMOVED__USE_MINGW_ANSI_STDIO
+#endif
 #include <stdlib.h>     /* abort(), malloc(), realloc(), free() */
 #include <string.h>     /* memcpy(), strlen() */
 #include <errno.h>      /* errno */
Index: gettext-0.19.2/gettext-runtime/libasprintf/vasnprintf.h
===================================================================
--- gettext-0.19.2.orig/gettext-runtime/libasprintf/vasnprintf.h
+++ gettext-0.19.2/gettext-runtime/libasprintf/vasnprintf.h
@@ -40,6 +40,8 @@
 extern "C" {
 #endif
 
+#if !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR)
+
 /* Write formatted output to a string dynamically allocated with malloc().
    You can pass a preallocated buffer for the result in RESULTBUF and its
    size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
@@ -64,11 +66,14 @@ extern "C" {
                 free (output);
             }
   */
+
 extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
        __attribute__ ((__format__ (__printf__, 3, 4)));
 extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
        __attribute__ ((__format__ (__printf__, 3, 0)));
 
+#endif /* !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR) */
+
 #ifdef __cplusplus
 }
 #endif
Index: gettext-0.19.2/gettext-runtime/libasprintf/vasprintf.h
===================================================================
--- gettext-0.19.2.orig/gettext-runtime/libasprintf/vasprintf.h
+++ gettext-0.19.2/gettext-runtime/libasprintf/vasprintf.h
@@ -37,6 +37,8 @@
 extern "C" {
 #endif
 
+#if !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR)
+
 /* Write formatted output to a string dynamically allocated with malloc().
    If the memory allocation succeeds, store the address of the string in
    *RESULT and return the number of resulting bytes, excluding the trailing
@@ -46,6 +48,8 @@ extern int asprintf (char **result, cons
 extern int vasprintf (char **result, const char *format, va_list args)
        __attribute__ ((__format__ (__printf__, 2, 0)));
 
+#endif /* !defined(__USE_MINGW_ANSI_STDIO) && defined(__MINGW64_VERSION_MAJOR) */
+
 #ifdef __cplusplus
 }
 #endif
