--- xv.h.orig 2005-10-31 20:49:18.000000000 +0100 +++ xv.h 2005-10-31 22:10:17.000000000 +0100 @@ -157,7 +157,7 @@ #ifndef VMS # include -# ifndef __NetBSD__ +# if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__APPLE__) # if !(defined __GLIBC__ && __GLIBC__ >= 2) extern int errno; /* SHOULD be in errno.h, but often isn't */ extern char *sys_errlist[]; /* this too... */ @@ -170,7 +170,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(__APPLE__) /* or all modern/glibc systems? */ # define ERRSTR(x) strerror(x) # else # define ERRSTR(x) sys_errlist[x] @@ -214,6 +214,8 @@ # if defined(hp300) || defined(hp800) || defined(NeXT) # include /* it's in 'sys' on HPs and NeXT */ +# elif defined(__APPLE__) +# include # else # include # endif @@ -347,7 +347,11 @@ #endif #ifndef S_IRWUSR -# define S_IRWUSR (S_IRUSR|__S_IWRITE) +# if defined(__FreeBSD__) || defined(__APPLE__) +# define S_IRWUSR (S_IRUSR|S_IWUSR) +# else +# define S_IRWUSR (S_IRUSR|__S_IWRITE) +# endif #endif #ifndef MAXPATHLEN @@ -380,7 +380,7 @@ * them later. */ #ifndef VMS /* VMS hates multi-line definitions */ # if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ - defined(__bsdi__) + defined(__FreeBSD__) || defined(__bsdi__) || defined(__APPLE__) # ifndef USE_MKSTEMP # define USE_MKSTEMP /* use 'mkstemp()' instead of 'mktemp()' */ # endif /* >> SECURITY ISSUE << */