BSD and POSIX

Finally got around to installing OpenBSD (rev 3.3) in a vmware partition.
Found that several #if BSD's were inappropriate for modern BSD's.  Haven't
installed FreeBSD or NetBSD, but based on reading their man pages,
these changes are needed there too.  Mostly due to POSIX time() signature.
This commit is contained in:
cohrs
2003-07-06 22:06:46 +00:00
parent 3f7873514e
commit 362518c3ac
6 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -521,7 +521,7 @@ E struct tm *FDECL(localtime, (const time_t *));
# endif # endif
# endif # endif
# if defined(ULTRIX) || defined(SYSV) || defined(MICRO) || defined(VMS) || defined(MAC) || (defined(HPUX) && defined(_POSIX_SOURCE)) # if defined(ULTRIX) || (defined(BSD) && defined(POSIX_TYPES)) || defined(SYSV) || defined(MICRO) || defined(VMS) || defined(MAC) || (defined(HPUX) && defined(_POSIX_SOURCE))
E time_t FDECL(time, (time_t *)); E time_t FDECL(time, (time_t *));
# else # else
E long FDECL(time, (time_t *)); E long FDECL(time, (time_t *));
+6 -2
View File
@@ -19,7 +19,7 @@
*/ */
/* define exactly one of the following four choices */ /* define exactly one of the following four choices */
/* #define BSD 1 */ /* define for 4.n BSD */ /* #define BSD 1 */ /* define for 4.n/Free/Open/Net BSD */
/* also for relatives like SunOS 4.x, DG/UX, and */ /* also for relatives like SunOS 4.x, DG/UX, and */
/* older versions of Linux */ /* older versions of Linux */
/* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */ /* #define ULTRIX */ /* define for Ultrix v3.0 or higher (but not lower) */
@@ -171,11 +171,15 @@
# ifdef AMS # ifdef AMS
#define AMS_MAILBOX "/Mailbox" #define AMS_MAILBOX "/Mailbox"
# else # else
# if defined(__FreeBSD__) || defined(__OpenBSD__)
#define DEF_MAILREADER "/usr/bin/mail"
# else
#define DEF_MAILREADER "/usr/ucb/Mail" #define DEF_MAILREADER "/usr/ucb/Mail"
# endif
# endif # endif
#else #else
# if (defined(SYSV) || defined(DGUX) || defined(HPUX)) && !defined(LINUX) # if (defined(SYSV) || defined(DGUX) || defined(HPUX)) && !defined(LINUX)
# if defined(M_XENIX) || defined(__FreeBSD__) # if defined(M_XENIX)
#define DEF_MAILREADER "/usr/bin/mail" #define DEF_MAILREADER "/usr/bin/mail"
# else # else
# ifdef __sgi # ifdef __sgi
+2
View File
@@ -930,6 +930,7 @@ restore_saved_game()
return fd; return fd;
} }
#if defined(UNIX) && defined(QT_GRAPHICS)
/*ARGSUSED*/ /*ARGSUSED*/
static char* static char*
plname_from_file(filename) plname_from_file(filename)
@@ -982,6 +983,7 @@ const char* filename;
} }
#endif #endif
} }
#endif /* defined(UNIX) && defined(QT_GRAPHICS) */
char** char**
get_saved_games() get_saved_games()
+4 -4
View File
@@ -467,7 +467,7 @@ setrandom()
srandom((unsigned int) time((time_t *)0)); srandom((unsigned int) time((time_t *)0));
#else #else
# if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */ # if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */
# ifdef BSD # if defined(BSD) && !defined(POSIX_TYPES)
# if defined(SUNOS4) # if defined(SUNOS4)
(void) (void)
# endif # endif
@@ -490,12 +490,12 @@ getlt()
{ {
time_t date; time_t date;
#ifdef BSD #if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *)(&date)); (void) time((long *)(&date));
#else #else
(void) time(&date); (void) time(&date);
#endif #endif
#if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) || defined(BSD) #if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) || (defined(BSD) && !defined(POSIX_TYPES))
return(localtime((long *)(&date))); return(localtime((long *)(&date)));
#else #else
return(localtime(&date)); return(localtime(&date));
@@ -542,7 +542,7 @@ time_t date;
if (date == 0) if (date == 0)
lt = getlt(); lt = getlt();
else else
#if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) || defined(BSD) #if (defined(ULTRIX) && !(defined(ULTRIX_PROTO) || defined(NHSTDC))) || (defined(BSD) && !defined(POSIX_TYPES))
lt = localtime((long *)(&date)); lt = localtime((long *)(&date));
#else #else
lt = localtime(&date); lt = localtime(&date);
+1 -1
View File
@@ -583,7 +583,7 @@ u_init()
aligns[flags.initalign].value; aligns[flags.initalign].value;
u.ulycn = NON_PM; u.ulycn = NON_PM;
#ifdef BSD #if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *)&u.ubirthday); (void) time((long *)&u.ubirthday);
#else #else
(void) time(&u.ubirthday); (void) time(&u.ubirthday);
+1 -1
View File
@@ -35,7 +35,7 @@ int fd;
#ifndef INSURANCE #ifndef INSURANCE
if(buf.st_size != sizeof(int)) return(0); /* not an xlock file */ if(buf.st_size != sizeof(int)) return(0); /* not an xlock file */
#endif #endif
#ifdef BSD #if defined(BSD) && !defined(POSIX_TYPES)
(void) time((long *)(&date)); (void) time((long *)(&date));
#else #else
(void) time(&date); (void) time(&date);