pkgsrc/graphics/xv/patches/patch-af
2011-02-14 20:37:40 +00:00

58 lines
1.6 KiB
Text

$NetBSD: patch-af,v 1.9 2011/02/14 20:37:40 wiz Exp $
Config fixups.
- don't declare errno and sys_errlist
- use strerror
- use getcwd, not getwd
--- xv.h.orig 2011-01-23 23:25:49.000000000 +0000
+++ xv.h
@@ -138,9 +138,7 @@
#endif
-#if defined(__FreeBSD__)
-# include <sys/param.h>
-#endif
+#include <sys/param.h>
/* include files */
@@ -159,7 +157,7 @@
#ifndef VMS
# include <errno.h>
# ifndef __NetBSD__
-# if !(defined __GLIBC__ && __GLIBC__ >= 2)
+# if !(defined(BSD) && (BSD >= 199103)) && !(defined __GLIBC__ && __GLIBC__ >= 2)
extern int errno; /* SHOULD be in errno.h, but often isn't */
extern char *sys_errlist[]; /* this too... */
# endif
@@ -171,7 +169,7 @@
#ifdef VMS
# define ERRSTR(x) strerror(x, vaxc$errno)
#else
-# if defined(__BEOS__) || defined(__linux__) /* or all modern/glibc systems? */
+# if defined(__BEOS__) || defined(__linux__) || defined(__INTERIX) || defined(__sun) /* or all modern/glibc systems? */
# define ERRSTR(x) strerror(x)
# else
# define ERRSTR(x) sys_errlist[x]
@@ -207,7 +205,9 @@
# if defined(hp300) || defined(hp800) || defined(NeXT)
# include <sys/malloc.h> /* it's in "sys" on HPs and NeXT */
# else
-# include <malloc.h>
+# ifndef __DARWIN__
+# include <malloc.h>
+# endif
# endif
#endif
@@ -391,7 +391,7 @@
# endif
#endif
-#if (defined(SYSV) || defined(SVR4) || defined(linux)) && !defined(USE_GETCWD)
+#if (defined(SYSV) || defined(SVR4) || defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)) && !defined(USE_GETCWD)
# define USE_GETCWD
#endif