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:
@@ -930,6 +930,7 @@ restore_saved_game()
|
||||
return fd;
|
||||
}
|
||||
|
||||
#if defined(UNIX) && defined(QT_GRAPHICS)
|
||||
/*ARGSUSED*/
|
||||
static char*
|
||||
plname_from_file(filename)
|
||||
@@ -982,6 +983,7 @@ const char* filename;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* defined(UNIX) && defined(QT_GRAPHICS) */
|
||||
|
||||
char**
|
||||
get_saved_games()
|
||||
|
||||
@@ -467,7 +467,7 @@ setrandom()
|
||||
srandom((unsigned int) time((time_t *)0));
|
||||
#else
|
||||
# if defined(__APPLE__) || defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) /* system srandom() */
|
||||
# ifdef BSD
|
||||
# if defined(BSD) && !defined(POSIX_TYPES)
|
||||
# if defined(SUNOS4)
|
||||
(void)
|
||||
# endif
|
||||
@@ -490,12 +490,12 @@ getlt()
|
||||
{
|
||||
time_t date;
|
||||
|
||||
#ifdef BSD
|
||||
#if defined(BSD) && !defined(POSIX_TYPES)
|
||||
(void) time((long *)(&date));
|
||||
#else
|
||||
(void) time(&date);
|
||||
#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)));
|
||||
#else
|
||||
return(localtime(&date));
|
||||
@@ -542,7 +542,7 @@ time_t date;
|
||||
if (date == 0)
|
||||
lt = getlt();
|
||||
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));
|
||||
#else
|
||||
lt = localtime(&date);
|
||||
|
||||
@@ -583,7 +583,7 @@ u_init()
|
||||
aligns[flags.initalign].value;
|
||||
u.ulycn = NON_PM;
|
||||
|
||||
#ifdef BSD
|
||||
#if defined(BSD) && !defined(POSIX_TYPES)
|
||||
(void) time((long *)&u.ubirthday);
|
||||
#else
|
||||
(void) time(&u.ubirthday);
|
||||
|
||||
Reference in New Issue
Block a user