46 lines
780 B
Text
46 lines
780 B
Text
$NetBSD: patch-ag,v 1.4 2004/01/23 09:02:15 agc Exp $
|
|
|
|
--- debug.c.orig Tue Jan 12 19:59:35 1993
|
|
+++ debug.c Mon Sep 6 18:37:05 1999
|
|
@@ -15,31 +15,28 @@
|
|
|
|
# include <X11/Intrinsic.h>
|
|
|
|
-# include <varargs.h>
|
|
+# include <stdarg.h>
|
|
# include <stdio.h>
|
|
|
|
# include "debug.h"
|
|
|
|
+#include "app.h"
|
|
+
|
|
+extern AppData app_data;
|
|
+
|
|
/* VARARGS */
|
|
void
|
|
-debug_printf(va_alist)
|
|
- va_dcl
|
|
+debug_printf(int p, char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
- char *fmt;
|
|
-
|
|
- va_start(args);
|
|
|
|
- /*
|
|
- * first arg is whether or not to print.
|
|
- */
|
|
- if ((va_arg(args, int) == 0) || (debug == False))
|
|
+ if (p == 0 || app_data.debug == False) {
|
|
return;
|
|
-
|
|
- fmt = va_arg(args, char *);
|
|
+ }
|
|
+ va_start(args, fmt);
|
|
vfprintf(stdout, fmt, args);
|
|
+ va_end(args);
|
|
|
|
fflush(stdout);
|
|
|
|
- va_end(args);
|
|
}
|