aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch')
-rw-r--r--main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch89
1 files changed, 89 insertions, 0 deletions
diff --git a/main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch b/main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch
new file mode 100644
index 0000000000..944f5253b4
--- /dev/null
+++ b/main/musl/0055-reapply-va_arg-hacks-removal-to-wprintf.patch
@@ -0,0 +1,89 @@
+From f6888840613a510c99915ba7732df8ec54d52637 Mon Sep 17 00:00:00 2001
+From: Alexander Monakov <amonakov@ispras.ru>
+Date: Tue, 4 Jul 2017 22:59:06 +0300
+Subject: [PATCH 55/55] reapply va_arg hacks removal to wprintf
+
+commit 58e2396a9aa23c132faf4198ca4d779c84955b38 missed that the same
+code was duplicated in implementation of vfwprintf.
+---
+ src/stdio/vfwprintf.c | 27 +--------------------------
+ 1 file changed, 1 insertion(+), 26 deletions(-)
+
+diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c
+index b8fff208..1e6e47cc 100644
+--- a/src/stdio/vfwprintf.c
++++ b/src/stdio/vfwprintf.c
+@@ -4,6 +4,7 @@
+ #include <limits.h>
+ #include <string.h>
+ #include <stdarg.h>
++#include <stddef.h>
+ #include <wchar.h>
+ #include <inttypes.h>
+
+@@ -19,14 +20,6 @@
+
+ #define FLAGMASK (ALT_FORM|ZERO_PAD|LEFT_ADJ|PAD_POS|MARK_POS|GROUPED)
+
+-#if UINT_MAX == ULONG_MAX
+-#define LONG_IS_INT
+-#endif
+-
+-#if SIZE_MAX != ULONG_MAX || UINTMAX_MAX != ULLONG_MAX
+-#define ODD_TYPES
+-#endif
+-
+ /* State machine to accept length modifiers + conversion specifiers.
+ * Result is 0 on failure, or an argument type to pop on success. */
+
+@@ -35,23 +28,9 @@ enum {
+ ZTPRE, JPRE,
+ STOP,
+ PTR, INT, UINT, ULLONG,
+-#ifndef LONG_IS_INT
+ LONG, ULONG,
+-#else
+-#define LONG INT
+-#define ULONG UINT
+-#endif
+ SHORT, USHORT, CHAR, UCHAR,
+-#ifdef ODD_TYPES
+ LLONG, SIZET, IMAX, UMAX, PDIFF, UIPTR,
+-#else
+-#define LLONG ULLONG
+-#define SIZET ULONG
+-#define IMAX LLONG
+-#define UMAX ULLONG
+-#define PDIFF LONG
+-#define UIPTR ULONG
+-#endif
+ DBL, LDBL,
+ NOARG,
+ MAXSTATE
+@@ -125,23 +104,19 @@ static void pop_arg(union arg *arg, int type, va_list *ap)
+ case PTR: arg->p = va_arg(*ap, void *);
+ break; case INT: arg->i = va_arg(*ap, int);
+ break; case UINT: arg->i = va_arg(*ap, unsigned int);
+-#ifndef LONG_IS_INT
+ break; case LONG: arg->i = va_arg(*ap, long);
+ break; case ULONG: arg->i = va_arg(*ap, unsigned long);
+-#endif
+ break; case ULLONG: arg->i = va_arg(*ap, unsigned long long);
+ break; case SHORT: arg->i = (short)va_arg(*ap, int);
+ break; case USHORT: arg->i = (unsigned short)va_arg(*ap, int);
+ break; case CHAR: arg->i = (signed char)va_arg(*ap, int);
+ break; case UCHAR: arg->i = (unsigned char)va_arg(*ap, int);
+-#ifdef ODD_TYPES
+ break; case LLONG: arg->i = va_arg(*ap, long long);
+ break; case SIZET: arg->i = va_arg(*ap, size_t);
+ break; case IMAX: arg->i = va_arg(*ap, intmax_t);
+ break; case UMAX: arg->i = va_arg(*ap, uintmax_t);
+ break; case PDIFF: arg->i = va_arg(*ap, ptrdiff_t);
+ break; case UIPTR: arg->i = (uintptr_t)va_arg(*ap, void *);
+-#endif
+ break; case DBL: arg->f = va_arg(*ap, double);
+ break; case LDBL: arg->f = va_arg(*ap, long double);
+ }
+--
+2.13.1
+