A quick purousal thru our port's patches directory shows a *WAY* over use of

__FreeBSD__.

That said, add __OpenBSD__ and __NetBSD__ where approapiate.
This commit is contained in:
David E. O'Brien 1997-02-16 21:11:14 +00:00
parent 8126c83bd2
commit 02d1b3a10b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=5656
8 changed files with 19 additions and 19 deletions

View file

@ -62,7 +62,7 @@
tm.tm_mday = date & 31;
tm.tm_mon = ((date >> 5) & 15) - 1;
tm.tm_year = (date >> 9) + 80;
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__)
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
tvp[0].tv_sec = tmclock(&tm);
+ #else
+ tvp[0].tv_sec = timelocal(&tm);

View file

@ -4,7 +4,7 @@
#if BZ_UNIX_32
#include <utime.h>
#include <unistd.h>
+#ifndef __FreeBSD__ /* stdlib already included above */
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) /* stdlib already included above */
#include <malloc.h>
+#endif
#include <sys/stat.h>

View file

@ -31,7 +31,7 @@
! gettz(stamp) /* returns the offset from GMT in seconds */
! time_t stamp;
{
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ return -localtime(&stamp)->tm_gmtoff;
+ #else
#define NOONOFFSET 43200L
@ -73,7 +73,7 @@
#endif
typedef unsigned char uchar; /* 8 bits or more */
+ #ifndef __FreeBSD__
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
typedef unsigned int uint; /* 16 - 32 bits or more */
typedef unsigned short ushort; /* 16 bits or more */
+ #endif

View file

@ -17,7 +17,7 @@
! long gettz(t)
! long t;
{
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ return -localtime(&t)->tm_gmtoff;
+ #else
#define SEC_IN_DAY (24L * 60L * 60L)
@ -54,7 +54,7 @@
/* Standard UNIX-specific file attribute routines */
#include "nixmode.i"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ #include <unistd.h>
+ #else
#ifndef SEEK_CUR
@ -222,7 +222,7 @@
/* uchar should be 8 bits or more */
/* typedef unsigned char uchar; -- already in zoo.h */
+ #ifndef __FreeBSD__
+ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
typedef unsigned int uint; /* 16 bits or more */
#if !defined(__386BSD__) || !defined(_TYPES_H_)
typedef unsigned short ushort; /* 16 bits or more */

View file

@ -78,7 +78,7 @@
#include <errno.h>
#include <perror.h>
#else
+#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
extern char *sys_errlist[];
+#endif
extern int errno;

View file

@ -218,7 +218,7 @@ diff -c --recursive ./plat_freebsd.c ../workman.new/./plat_freebsd.c
}
if (ioctl(d->fd, CDIOCREADSUBCHANNEL, &sc)) {
! #if defined(__NetBSD__) || defined(__FreeBSD__)
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/* we need to release the device so the kernel will notice
reloaded media */
(void) close(d->fd);
@ -252,12 +252,12 @@ diff -c --recursive ./plat_freebsd.c ../workman.new/./plat_freebsd.c
if (fstatfs(stbuf.st_rdev, &buf) == 0)
return (-3);
! #if defined(__NetBSD__) || defined(__FreeBSD__)
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
rval = ioctl(d->fd, CDIOCALLOW);
if (rval == 0)
#endif
rval = ioctl(d->fd, CDIOCEJECT);
! #if defined(__NetBSD__) || defined(__FreeBSD__)
! #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
if (rval == 0)
rval = ioctl(d->fd, CDIOCPREVENT);
#endif
@ -300,7 +300,7 @@ diff -c --recursive ./workman_stubs.c ../workman.new/./workman_stubs.c
Panel_item quitbutton;
char *getenv(), *WMstrdup();
+ #if defined(__FreeBSD__)
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ /* FreeBSD has a special directory for pidfiles, I guess. */
+ char *pidfile = "/var/run/workman.pid";
+ #else

View file

@ -6,7 +6,7 @@
# include <X11/Xaw/Toggle.h>
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun
@ -74,7 +74,7 @@
# include "debug.h"
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun
@ -88,7 +88,7 @@
# include "debug.h"
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun
@ -139,7 +139,7 @@
# include <stdio.h>
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun
@ -208,7 +208,7 @@
# include "debug.h"
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun
@ -258,7 +258,7 @@
# include "debug.h"
# include "cdrom_globs.h"
+ #ifdef __FreeBSD__
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ # include "cdrom_freebsd.h"
+ #endif
#ifdef sun

View file

@ -4,7 +4,7 @@
#else
#define strchr index
extern char *strchr();
+#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
extern char *sprintf();
+#else
+extern int sprintf();