From 86957330baff19a4064043ed64fa953630d4896f Mon Sep 17 00:00:00 2001
From: cshapiro <cshapiro>
Date: Tue, 18 Mar 2008 09:22:55 +0000
Subject: [PATCH] The FreeBSD-os.h header imported headers that its definitions
 did not make direct use of.  Remove the includes of these headers and fix-up
 several files that indirectly depended on them.

* FreeBSD-os.c - add stdio.h and unistd.h includes that were
  implicitly depended on.  Remove unused or commented system includes.

* FreeBSD-os.h - remove unused includes.  Include signal.h to directly
  provide the SIGBUS, SIGSEGV, and sub-code definitions.  Redefine
  os_vm_address_t and os_vm_size_t in terms of standard types.  Now
  that the sys/param.h include is gone we no longer need to undefine
  PAGE_SIZE.

* elf.c - add includes that were implicitly depended on.

* lisp.c - remove unused system includes including sys/param.h which
  redefines PAGE_SIZE.
---
 lisp/FreeBSD-os.c |  6 +++---
 lisp/FreeBSD-os.h | 16 ++++------------
 lisp/elf.c        |  3 ++-
 lisp/lisp.c       |  5 +----
 4 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/lisp/FreeBSD-os.c b/lisp/FreeBSD-os.c
index a41b732a5..12f12b365 100644
--- a/lisp/FreeBSD-os.c
+++ b/lisp/FreeBSD-os.c
@@ -12,7 +12,7 @@
  * Much hacked by Paul Werkowski
  * GENCGC support by Douglas Crosher, 1996, 1997.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.22 2008/01/03 11:41:54 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.23 2008/03/18 09:22:55 cshapiro Exp $
  *
  */
 
@@ -27,10 +27,10 @@
 #include "internals.h"
 
 #include <signal.h>
-/* #include <sys/sysinfo.h> */
-#include <sys/proc.h>
 #include <dlfcn.h>
 #include "validate.h"
+#include <stdio.h>
+#include <unistd.h>
 
 #if defined GENCGC
 #include "gencgc.h"
diff --git a/lisp/FreeBSD-os.h b/lisp/FreeBSD-os.h
index 5a0aa94e8..19c710c37 100644
--- a/lisp/FreeBSD-os.h
+++ b/lisp/FreeBSD-os.h
@@ -1,6 +1,6 @@
 /*
 
- $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.21 2008/01/03 11:41:54 cshapiro Exp $
+ $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.22 2008/03/18 09:22:55 cshapiro Exp $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -10,20 +10,14 @@
 #ifndef _FREEBSD_OS_H_
 #define _FREEBSD_OS_H_
 
-#include <sys/param.h>
-#include <sys/uio.h>
 #include <sys/mman.h>
-#include <sys/signal.h>
 
 #include <osreldate.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
+#include <signal.h>
 #include <ucontext.h>
 
-typedef caddr_t os_vm_address_t;
-typedef vm_size_t os_vm_size_t;
+typedef void *os_vm_address_t;
+typedef size_t os_vm_size_t;
 typedef off_t os_vm_offset_t;
 typedef int os_vm_prot_t;
 #define os_context_t ucontext_t
@@ -48,6 +42,4 @@ void restore_fpu(ucontext_t *);
 #define PROTECTION_VIOLATION_CODE SEGV_ACCERR
 #endif
 
-#undef PAGE_SIZE
-
 #endif /* _FREEBSD_OS_H_ */
diff --git a/lisp/elf.c b/lisp/elf.c
index 0818bdd42..ca0a1c42e 100644
--- a/lisp/elf.c
+++ b/lisp/elf.c
@@ -8,7 +8,7 @@
 
  Above changes put into main CVS branch. 05-Jul-2007.
 
- $Id: elf.c,v 1.16 2008/03/18 08:47:48 cshapiro Exp $
+ $Id: elf.c,v 1.17 2008/03/18 09:22:55 cshapiro Exp $
 */
 
 #include <stdio.h>
@@ -17,6 +17,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <unistd.h>
 
 #include "os.h"
 #include "core.h"
diff --git a/lisp/lisp.c b/lisp/lisp.c
index 32c6d00ff..51d0abe62 100644
--- a/lisp/lisp.c
+++ b/lisp/lisp.c
@@ -1,16 +1,13 @@
 /*
  * main() entry point for a stand alone lisp image.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.61 2008/03/18 08:47:48 cshapiro Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.c,v 1.62 2008/03/18 09:22:55 cshapiro Exp $
  *
  */
 
 #include <stdio.h>
-#include <sys/types.h>
 #include <stdlib.h>
 #include <limits.h>
-#include <sys/file.h>
-#include <sys/param.h>
 #include <sys/stat.h>
 #include <string.h>
 #include <unistd.h>
-- 
GitLab