[nexuiz-commits] r6716 - trunk/misc/tools

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue May 12 08:01:04 EDT 2009


Author: div0
Date: 2009-05-12 08:01:04 -0400 (Tue, 12 May 2009)
New Revision: 6716

Modified:
   trunk/misc/tools/hitplot2tga.c
Log:
remove <err.h> dependency to make it compile on stupid operating systems too


Modified: trunk/misc/tools/hitplot2tga.c
===================================================================
--- trunk/misc/tools/hitplot2tga.c	2009-05-12 11:23:31 UTC (rev 6715)
+++ trunk/misc/tools/hitplot2tga.c	2009-05-12 12:01:04 UTC (rev 6716)
@@ -1,10 +1,23 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <err.h>
 #include <string.h>
 #include <math.h>
+#include <stdarg.h>
+#include <errno.h>
 
+void err(int ex, const char *fmt, ...)
+{
+	va_list list;
+	int e = errno;
+	va_start(list, fmt);
+	vfprintf(stderr, fmt, list);
+	fputs(": ", stderr);
+	fputs(strerror(e), stderr);
+	fputs("\n", stderr);
+	exit(ex);
+}
+
 typedef void (*colorfunc_t) (double x, double y, double dx, double dy, double *r, double *g, double *b);
 
 double rnd()



More information about the nexuiz-commits mailing list