blob: 7995d7923e448ffd43e08bb03d64172c909914b5 (
plain)
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
|
$NetBSD: patch-av,v 1.3 2005/12/19 15:15:47 joerg Exp $
--- compface/cmain.c.orig 1991-10-24 02:28:07.000000000 +0000
+++ compface/cmain.c
@@ -33,12 +33,21 @@ char *cmdname;
/* error handling definitions follow */
-extern int errno, sys_nerr;
+#include <errno.h>
+#include <stdio.h>
+
+#if !defined(__NetBSD__) && !defined(__INTERIX) && !defined(__DragonFly__) && !defined(__FreeBSD__)
+extern int sys_nerr;
extern char *sys_errlist[];
+#endif
extern void exit P((int)) ;
+#ifdef __INTERIX
+#define ERR strerror(errno)
+#else
#define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "")
+#endif
#define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\
(void)strcat(fbuf, (s));}
#define ADDERR(s) (void)strcat(fbuf, (s));
|