forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kcc-gcc3-gentoo.diff
47 lines (43 loc) · 1 KB
/
kcc-gcc3-gentoo.diff
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
--- a/kcc.c
+++ b/kcc.c
@@ -134,7 +134,11 @@
extern unsigned short hiragana[];
unsigned short *kanatbl = katakana;
+#ifdef __STDC__
+void error(char *format, ...);
+#else
void error();
+#endif
/**********************************************************************
* *
@@ -364,14 +368,30 @@
NAME
error - print formatted error message on stderr and die
---------------------------------------------------------------------*/
+#ifdef __STDC__
+#include <stdarg.h>
+#else
#include <varargs.h>
+#endif
-void error(va_alist)
- va_dcl
+void
+#ifdef __STDC__
+error(char *format, ...)
+#else
+error(va_alist) va_dcl
+#endif
{
va_list args;
+#ifdef __STDC__
+ va_start(args, format);
+#else
+ char *format;
+
va_start(args);
+ /* extract the fixed argument */
+ format = va_arg(args, char *);
+#endif
fprintf(stderr, "%s: ", progname);
vfprintf(stderr, va_arg(args, char *), args);
putc('\n', stderr);