From 02569edbe0a9c1e2e6ca3292e6267baabc777004 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Thu, 25 May 2017 12:51:47 -0700 Subject: [PATCH] First cleanup to get to compiling (warnings, no errors) FreeBSD --- bin/makefile-freebsd.386-x | 6 +++--- src/dsk.c | 14 ++++++++++---- src/initsout.c | 4 ++-- src/lisp2c.c | 1 + src/main.c | 10 +++++++++- src/osmsg.c | 2 ++ src/perrno.c | 2 +- src/ufs.c | 8 +++++--- src/uraid.c | 7 +++++-- src/vmemsave.c | 4 +++- src/xcursor.c | 2 +- src/xinit.c | 2 ++ 12 files changed, 44 insertions(+), 18 deletions(-) diff --git a/bin/makefile-freebsd.386-x b/bin/makefile-freebsd.386-x index c62d292..b963f57 100755 --- a/bin/makefile-freebsd.386-x +++ b/bin/makefile-freebsd.386-x @@ -19,14 +19,14 @@ XFLAGS = -I/usr/local/include -DXWINDOW -DNOPIXRECT -D$(XVERSION) # $(CLXFLAGS) # This is to make the %$#@! Apollo cc happy OEXT = .o # OPTFLAGS is normally -O2. -OPTFLAGS = -Ofast -g -DISPOPTFLAGS = -O -g +OPTFLAGS = -O1 -gdwarf-2 +DISPOPTFLAGS = -O1 -gdwarf-2 FPFLAGS = DFLAGS = -DFSERROR -DNEW_STORAGE -DFREEBSD -DOLD_CURSOR -DUSETERMIOS \ -DBYTESWAP -DFORKCOMM -DNOFORN -DLOGINT $(XFLAGS) \ -DRELEASE=351 -D__USE_BSD -LDFLAGS = -L/usr/local/lib -lX11 -lc -lm +LDFLAGS = -L/usr/local/lib -lX11 -lc -lm -lcrypt LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm INLINE = # $(SRCDIR)dspSPARC.il diff --git a/src/dsk.c b/src/dsk.c index e443acb..c8caf3b 100755 --- a/src/dsk.c +++ b/src/dsk.c @@ -17,7 +17,9 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #include "version.h" - +#if defined(MACOSX) || defined(FREEBSD) +#include +#endif #include #ifndef DOS @@ -27,7 +29,11 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #include #endif /* OS5 Solaris doesn't need strings.h */ #ifndef SYSVONLY +#ifndef MACOSX +#ifndef FREEBSD #include +#endif /* FREEBSD */ +#endif /* MACOSX */ #endif /* SYSVONLY */ #include @@ -82,7 +88,7 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #endif /* ISC */ -#ifdef SYSVONLY +#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) #include #include #define direct dirent @@ -111,7 +117,7 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright #include "osmsg.h" #include "dbprint.h" -#if defined(ULTRIX) || defined(MACOSX) +#if defined(ULTRIX) || defined(MACOSX) || defined(FREEBSD) #include #elif OSF1 #include @@ -2527,7 +2533,7 @@ COM_getfreeblock(args) #elif defined(LINUX) TIMEOUT(rval = statfs(dir, &sfsbuf)); if (rval != 0) { -#elif defined(MACOSX) +#elif defined(MACOSX) || defined(FREEBSD) TIMEOUT(rval = statfs(dir, &sfsbuf)); if (rval != 0) { #elif HPUX diff --git a/src/initsout.c b/src/initsout.c index ee10832..77ad411 100755 --- a/src/initsout.c +++ b/src/initsout.c @@ -27,7 +27,7 @@ static char *id = "$Id: initsout.c,v 1.3 1999/05/31 23:35:34 sybalsky Exp $ Copy #include #include -#ifdef MACOSX +#if defined(MACOSX) || defined(FREEBSD) #include #else #include @@ -172,7 +172,7 @@ init_ifpage(int sysout_size) char *s = (char*)Addr68k_from_LADDR(0155001); /* try getpwuid first; use cuserid if it fails */ if((pwd = getpwuid(getuid())) == NULL) -#ifdef MACOSX +#if defined(MACOSX) || defined(FREEBSD) ; #else cuserid(s+1); diff --git a/src/lisp2c.c b/src/lisp2c.c index 5061e3d..2cb3447 100755 --- a/src/lisp2c.c +++ b/src/lisp2c.c @@ -19,6 +19,7 @@ static char *id = "$Id: lisp2c.c,v 1.3 1999/05/31 23:35:37 sybalsky Exp $ Copyri #include "version.h" +#include /* for sprintf */ #include "lispemul.h" #include "lspglob.h" diff --git a/src/main.c b/src/main.c index 7ba0a77..197b72a 100755 --- a/src/main.c +++ b/src/main.c @@ -31,7 +31,7 @@ static char *id = "$Id: main.c,v 1.4 2001/12/26 22:17:03 sybalsky Exp $ Copyrigh #ifndef DOS #include #include -#else +#else /* DOS */ #define MAXPATHLEN 128 #define R_OK 04 #define index strchr @@ -75,6 +75,10 @@ static char *id = "$Id: main.c,v 1.4 2001/12/26 22:17:03 sybalsky Exp $ Copyrigh #include #endif +#if defined(MACOSX) || defined(FREEBSD) +#include +#endif + #include #include "emlglob.h" @@ -859,7 +863,11 @@ print_info_lines () #elif (RELEASE == 351) printf("Emulator for Medley release 3.51\n"); #endif /* RELEASE */ +#if defined(MACOSX) || defined(FREEBSD) + printf("Creation date: %s", ctime((const time_t *)&MDate)); +#else printf("Creation date: %s", ctime(&MDate)); +#endif #ifdef DEMO printf("Demonstration emulator, not for commercial use\n"); #endif /* DEMO */ diff --git a/src/osmsg.c b/src/osmsg.c index b89859a..779acbc 100755 --- a/src/osmsg.c +++ b/src/osmsg.c @@ -54,7 +54,9 @@ static char *id = "$Id: osmsg.c,v 1.2 1999/01/03 02:07:29 sybalsky Exp $ Copyrig #ifndef AIX #ifndef APOLLO #ifndef MACOSX +#ifndef FREEBSD #include +#endif /* FREEBSD */ #endif /* MACOSX */ #endif /* APOLLO */ #endif /* AIX */ diff --git a/src/perrno.c b/src/perrno.c index 36b0aba..c3ad3d2 100755 --- a/src/perrno.c +++ b/src/perrno.c @@ -38,7 +38,7 @@ static char *id = "$Id: perrno.c,v 1.4 2001/12/26 22:17:04 sybalsky Exp $ Copyri /************************************************************************/ extern int errno; -#ifdef MACOSX +#if defined(MACOSX) || defined(FREEBSD) extern const char * const sys_errlist[]; extern const int sys_nerr; #else diff --git a/src/ufs.c b/src/ufs.c index 42c5201..ae8f7e6 100755 --- a/src/ufs.c +++ b/src/ufs.c @@ -24,10 +24,10 @@ static char *id = "$Id: ufs.c,v 1.2 1999/01/03 02:07:41 sybalsky Exp $ Copyright #include #ifndef DOS #include -#ifndef SYSVONLY -#include +#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) +#include #else -#include +#include #endif /* SYSVONLY */ #include @@ -45,7 +45,9 @@ static char *id = "$Id: ufs.c,v 1.2 1999/01/03 02:07:41 sybalsky Exp $ Copyright #ifndef AIX #ifndef APOLLO #ifndef MACOSX +#ifndef FREEBSD #include +#endif /* FREEBSD */ #endif /* MACOSX */ #endif /* APOLLO */ #endif /* AIX */ diff --git a/src/uraid.c b/src/uraid.c index fd35334..8f70de3 100755 --- a/src/uraid.c +++ b/src/uraid.c @@ -73,7 +73,10 @@ extern int Win_security_p; #ifdef OS5 #include #endif /* OS5 */ - +#ifdef FREEBSD +/* for memset */ +#include +#endif #include "lispemul.h" #include "lispmap.h" @@ -388,7 +391,7 @@ uraid_commands() LispPTR index; DefCell *defcell68k; #ifndef DOS -#ifdef SYSVONLY +#if defined(SYSVONLY) || defined(WAITINT) int status; #else union wait status; diff --git a/src/vmemsave.c b/src/vmemsave.c index 6dc5d1f..3f97359 100755 --- a/src/vmemsave.c +++ b/src/vmemsave.c @@ -37,7 +37,9 @@ static char *id = "$Id: vmemsave.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ Copy #include #ifndef AIX #ifndef MACOSX +#ifndef FREEBSD #include +#endif /* FREEBSD */ #endif /* MACOSX */ #endif /* AIX */ @@ -47,7 +49,7 @@ static char *id = "$Id: vmemsave.c,v 1.2 1999/01/03 02:07:45 sybalsky Exp $ Copy #include #include -#ifdef SYSVONLY +#if defined(SYSVONLY) || defined(MACOSX) || defined(FREEBSD) #include #include #include diff --git a/src/xcursor.c b/src/xcursor.c index 94c930d..e2021ee 100755 --- a/src/xcursor.c +++ b/src/xcursor.c @@ -21,7 +21,7 @@ static char *id = "$Id: xcursor.c,v 1.4 2001/12/26 22:17:06 sybalsky Exp $ Copyr #include -#ifdef MACOSX +#if defined(MACOSX) || defined(FREEBSD) #include #else #include diff --git a/src/xinit.c b/src/xinit.c index 01d148e..9a21d2f 100755 --- a/src/xinit.c +++ b/src/xinit.c @@ -47,7 +47,9 @@ static char *id = "$Id: xinit.c,v 1.5 2001/12/26 22:17:06 sybalsky Exp $ Copyrig #ifndef ULTRIX #ifndef LINUX #ifndef MACOSX +#ifndef FREEBSD #include +#endif /* FREEBSD */ #endif /* MACOSX */ #endif /* LINUX */ #endif /* ULTRIX */