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
|
--- sim/log.c.orig Wed Oct 7 04:52:51 1992
+++ sim/log.c Tue Dec 9 19:59:48 2003
@@ -23,7 +23,7 @@
#include "packet.h"
#include "event.h"
#include "log.h"
-#include <varargs.h>
+#include <stdarg.h>
#ifdef DEBUG
extern Log debug_log;
@@ -59,13 +59,7 @@
/* Debugging log-- writes name of component along with message */
/*VARARGS4*/
/*dbg_write(l, level, c, format, args)*/
-dbg_write(l, level, c, format, va_alist)
- Log l;
- int level;
- Component *c;
- char *format;
- va_dcl
-
+dbg_write(Log l, int level, Component *c, char *format, ... )
{
va_list p;
@@ -79,8 +73,12 @@
}
/* Add the time */
fprintf(l, "%d ", ev_now());
- va_start(p);
+ va_start(p, format);
+#ifdef __FreeBSD__
+ vfprintf(l, format, p);
+#else
_doprnt(format, p, l);
+#endif
va_end(p);
fputs("\n\0", l);
fflush(l);
|