summaryrefslogtreecommitdiff
path: root/lang/gcc46/patches/patch-libiberty_vsnprintf.c
blob: bcba0a20fefcc9ddc59c5acc303a878eaac8160d (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
$NetBSD: patch-libiberty_vsnprintf.c,v 1.1 2016/09/06 13:57:02 maya Exp $

use stdarg, not VA_* macros.
cherry picked necessary parts from
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206881

fixes PR pkg/50042

--- libiberty/vsnprintf.c.orig	2011-02-03 07:23:20.000000000 +0000
+++ libiberty/vsnprintf.c
@@ -95,12 +95,10 @@ static int ATTRIBUTE_PRINTF_3
 checkit (char *s, size_t n, const char *format, ...)
 {
   int result;
-  VA_OPEN (ap, format);
-  VA_FIXEDARG (ap, char *, s);
-  VA_FIXEDARG (ap, size_t, n);
-  VA_FIXEDARG (ap, const char *, format);
+  va_list ap;
+  va_start (ap, format);
   result = vsnprintf (s, n, format, ap);
-  VA_CLOSE (ap);
+  va_end (ap);
   return result;
 }