summarylogtreecommitdiffstats
path: root/07-fix-asprintf-conflict.mingw.patch
blob: 725d2c797ad1879308879858486f2f0ef97bc9c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- gettext-runtime/libasprintf/vasnprintf.h.orig	2013-01-17 09:09:12 +0400
+++ gettext-runtime/libasprintf/vasnprintf.h	2013-05-01 17:33:31 +0400
@@ -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 @@
                 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
--- gettext-runtime/libasprintf/vasprintf.h.orig	2013-04-30 09:03:19 +0400
+++ gettext-runtime/libasprintf/vasprintf.h	2013-05-01 17:32:04 +0400
@@ -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 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
--- gettext-runtime/libasprintf/vasnprintf.c.orig	2013-05-01 18:07:02 +0400
+++ gettext-runtime/libasprintf/vasnprintf.c	2013-05-01 18:42:46 +0400
@@ -67,7 +67,14 @@
 #endif
 
 #include <locale.h>     /* localeconv() */
+#if defined(__MINGW64_VERSION_MAJOR) && defined(__USE_MINGW_ANSI_STDIO)
+#  define REMOVED__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
+#endif
 #include <stdlib.h>     /* abort(), malloc(), realloc(), free() */
 #include <string.h>     /* memcpy(), strlen() */
 #include <errno.h>      /* errno */