fix build on CURRENT

- s|varargs.h|stdarg.h|
 - s|void va_start(va_list ap);|void va_start(va_list ap, last);|g
This commit is contained in:
Oliver Lehmann 2003-08-07 17:26:45 +00:00
parent cb45784053
commit db7b3df375
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=86519
4 changed files with 132 additions and 6 deletions

View file

@ -1,14 +1,34 @@
--- ../../work.orig/elk-3.0/src/print.c Thu Apr 4 08:25:04 1996
+++ src/print.c Mon Oct 21 15:48:05 2002
@@ -5,6 +5,7 @@
--- src/print.c.orig Thu Apr 4 15:25:04 1996
+++ src/print.c Thu Aug 7 18:42:43 2003
@@ -5,7 +5,8 @@
#include <errno.h>
#include <ctype.h>
-#include <varargs.h>
+#include <string.h>
#include <varargs.h>
+#include <stdarg.h>
#ifdef FLUSH_TIOCFLUSH
@@ -555,10 +556,6 @@
# include <sys/ioctl.h>
@@ -95,15 +96,11 @@
#endif
/*VARARGS0*/
-Printf (va_alist) va_dcl {
+Printf (Object port, char *fmt, ...) {
va_list args;
- Object port;
- char *fmt;
char buf[1024];
- va_start (args);
- port = va_arg (args, Object);
- fmt = va_arg (args, char *);
+ va_start (args, fmt);
if (PORT(port)->flags & P_STRING) {
vsprintf (buf, fmt, args);
Print_String (port, buf, strlen (buf));
@@ -555,10 +552,6 @@
char *p;
register c;
char buf[256];
@ -19,7 +39,7 @@
GC_Node;
Alloca_Begin;
@@ -573,13 +570,13 @@
@@ -573,13 +566,13 @@
} else if (c == '%') {
Print_Char (port, '\n');
} else if (c == 'e' || c == 'E') {

44
lang/elk/files/patch-ao Normal file
View file

@ -0,0 +1,44 @@
--- src/error.c.orig Thu Aug 7 18:31:32 2003
+++ src/error.c Thu Aug 7 18:38:46 2003
@@ -1,5 +1,5 @@
#include <ctype.h>
-#include <varargs.h>
+#include <stdarg.h>
#include "kernel.h"
@@ -40,13 +40,11 @@
/*VARARGS1*/
Fatal_Error (foo) char *foo; { foo = foo; }
#else
-Fatal_Error (va_alist) va_dcl {
+Fatal_Error (char *fmt, ...) {
va_list args;
- char *fmt;
Disable_Interrupts;
- va_start (args);
- fmt = va_arg (args, char *);
+ va_start (args, fmt);
(void)fflush (stdout);
if (appname)
fprintf (stderr, "\n%s: fatal error: ", appname);
@@ -89,15 +87,14 @@
/*VARARGS1*/
Primitive_Error (foo) char *foo; { foo = foo; }
#else
-Primitive_Error (va_alist) va_dcl {
+Primitive_Error (char *fmt, ...) {
va_list args;
- register char *p, *fmt;
+ register char *p;
register i, n;
Object msg, sym, argv[10];
GC_Node; GCNODE gcv;
- va_start (args);
- fmt = va_arg (args, char *);
+ va_start (args, fmt);
for (n = 0, p = fmt; *p; p++)
if (*p == '~' && p[1] != '~' && p[1] != '%'
&& p[1] != 'E' && p[1] != 'e')

31
lang/elk/files/patch-ap Normal file
View file

@ -0,0 +1,31 @@
--- include/extern.h.orig Thu Aug 7 18:36:06 2003
+++ include/extern.h Thu Aug 7 19:00:01 2003
@@ -82,8 +82,8 @@
/* Error handling
*/
-extern Primitive_Error P_((ELLIPSIS));
-extern Fatal_Error P_((ELLIPSIS));
+extern Primitive_Error P_((char*, ...));
+extern Fatal_Error P_((char*, ...));
extern Range_Error P_((Object));
extern Panic P_((const char*));
extern Object P_Error P_((int, Object*));
@@ -313,7 +313,7 @@
extern Object P_Get_Output_String P_((Object));
extern Check_Output_Port P_((Object));
extern Discard_Output P_((Object));
-extern Printf P_((ELLIPSIS));
+extern Printf P_((Object, char*, ...));
extern Print_Object P_((Object, Object, int, int, int));
extern General_Print_Object P_((Object, Object, int));
extern Format P_((Object, const char*, int, int, Object*));
@@ -433,7 +433,7 @@
*/
extern void Register_Object P_((Object, GENERIC, PFO, int));
extern void Deregister_Object P_((Object));
-extern Object Find_Object P_((ELLIPSIS));
+extern Object Find_Object P_((int, GENERIC, MATCHFUN, ...));
extern void Terminate_Group P_((GENERIC));
extern void Terminate_Type P_((int));

31
lang/elk/files/patch-aq Normal file
View file

@ -0,0 +1,31 @@
--- src/terminate.c.orig Thu Aug 7 18:57:35 2003
+++ src/terminate.c Thu Aug 7 19:09:22 2003
@@ -1,7 +1,7 @@
/* Termination functions, weak pointers.
*/
-#include <varargs.h>
+#include <stdarg.h>
#include "kernel.h"
@@ -50,17 +50,11 @@
* Null is returned when the object has not been found.
*/
/*VARARGS*/
-Object Find_Object (va_alist) va_dcl {
+Object Find_Object (int type, GENERIC group, MATCHFUN match, ...) {
WEAK_NODE *p;
- int type;
- GENERIC group;
- MATCHFUN match;
va_list args;
- va_start (args);
- type = va_arg (args, int);
- group = va_arg (args, GENERIC);
- match = va_arg (args, MATCHFUN);
+ va_start (args, match);
for (p = first; p; p = p->next) {
if (TYPE(p->obj) != type || p->group != group)
continue;