41 lines
776 B
Plaintext
41 lines
776 B
Plaintext
$OpenBSD: patch-debug_c,v 1.2 2003/12/29 21:38:34 espie Exp $
|
|
--- debug.c.orig 1993-01-12 19:59:35.000000000 +0100
|
|
+++ debug.c 2003-12-29 22:34:24.000000000 +0100
|
|
@@ -15,28 +15,29 @@
|
|
|
|
# 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, const 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);
|
|
|
|
fflush(stdout);
|