Files
MINGW-packages/mingw-w64-gettext/0022-libasprintf.patch
2023-10-27 21:28:34 +02:00

29 lines
983 B
Diff

Do not replace names of asprintf and vasprintf while including a header
that pulls in stdio.h which also declares functions with that names.
These function declarations would conflict with the declarations from
this library.
diff -urN gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c.orig gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c
--- gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c.orig 2019-05-11 13:29:32.000000000 +0200
+++ gettext-0.22.3/gettext-runtime/libasprintf/vasprintf.c 2023-10-27 18:58:18.838760500 +0200
@@ -27,8 +27,19 @@
#include <limits.h>
#include <stdlib.h>
+#undef asprintf
+#undef vasprintf
+
#include "vasnprintf.h"
+#if !(HAVE_VASPRINTF && HAVE_POSIX_PRINTF)
+
+/* Define to the same symbols as in lib-asprintf.h. */
+#define asprintf libasprintf_asprintf
+#define vasprintf libasprintf_vasprintf
+
+#endif
+
/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
#ifndef EOVERFLOW
# define EOVERFLOW E2BIG