Change order of file inclusion and other small mods to satisfy vanilla sysv.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 3 Jun 1992 21:54:31 +0000 (21:54 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 3 Jun 1992 21:54:31 +0000 (21:54 +0000)
v7/src/microcode/bchdmp.c
v7/src/microcode/bchgcc.h

index b763d7486aa4e94698728772391774dee7287025..46342978d4fdd1b6a76cc54da0c2a9be1de582d1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.64 1992/05/04 18:32:03 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.65 1992/06/03 21:54:18 jinx Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -42,19 +42,11 @@ MIT in each case. */
 #include "trap.h"
 #include "lookup.h"            /* UNCOMPILED_VARIABLE */
 #define In_Fasdump
-#include "bchgcc.h"
 #include "fasl.h"
-
 \f
 #ifdef DOS386
-#include "msdos.h"
-#include "dosio.h"
-
-int
-DEFUN (ftruncate, (fd, size), int fd AND unsigned long size)
-{
-  return size;
-}
+#  include "msdos.h"
+#  include "dosio.h"
 
 char *
 DEFUN (mktemp, (fname), unsigned char * fname)
@@ -64,19 +56,28 @@ DEFUN (mktemp, (fname), unsigned char * fname)
   return;
 }
 
-#define FASDUMP_FILENAME "\\tmp\\fasdump.bin"
+#  define FASDUMP_FILENAME "\\tmp\\fasdump.bin"
 
-#else
+#else /* not DOS386 */
 
-#include "ux.h"
-#include "uxio.h"
+#  include "ux.h"
+#  include "uxio.h"
 extern int EXFUN (unlink, (CONST char *));
 
-#define FASDUMP_FILENAME "/tmp/fasdumpXXXXXX"
+#  define FASDUMP_FILENAME "/tmp/fasdumpXXXXXX"
+
+#if defined(_HPUX) || defined(_SUNOS4) || defined(_ULTRIX) || defined(_SYSV4)
+#  define HAVE_FTRUNCATE
+#endif
+
+#if (defined(_HPUX) && (_HPUX_VERSION >= 80)) || defined(_SYSV4)
+#  define FTRUNCATE_DECLARED
+#endif
 
 #endif /* DOS386 */
 
-\f
+#include "bchgcc.h"
+
 static Tchannel dump_channel;
 
 #define Write_Data(size, buffer)                                       \
@@ -247,10 +248,6 @@ do {                                                                       \
   BCH_STORE_CLOSURE_ENTRY_ADDRESS (Temp, Scan);                                \
 }
 \f
-#if (defined(_HPUX) && (_HPUX_VERSION >= 80)) || defined(_SYSV4)
-#define FTRUNCATE_DECLARED
-#endif
-
 Boolean
 DEFUN (fasdump_exit, (length), long length)
 {
@@ -260,7 +257,7 @@ DEFUN (fasdump_exit, (length), long length)
   Free = saved_free;
   restore_gc_file ();
 
-#if TRUE
+#ifdef HAVE_FTRUNCATE
   {
 #ifndef FTRUNCATE_DECLARED
     extern int EXFUN (ftruncate, (int, unsigned long));
@@ -269,13 +266,17 @@ DEFUN (fasdump_exit, (length), long length)
     result = ((close (dump_file)) == 0);
   }
 #else
+
+  result = (close (dump_file) == 0);
+
+#endif /* HAVE_FTRUNCATE */
+#if defined(HAVE_TRUNCATE) && !defined(HAVE_FTRUNCATE)
   {
     extern int EXFUN (truncate, (CONST char *, unsigned long));
 
-    result = (close (dump_file) == 0);
     truncate (dump_file_name, length);
   }
-#endif
+#endif /* HAVE_TRUNCATE */
 
   if (length == 0)
   {
@@ -295,6 +296,9 @@ next_buffer:
 
   if (fixup_count >= 0)
   {
+#if defined(_SYSV3) && !defined(_HPUX)
+    extern int EXFUN (read, (int, char *, int));
+#endif
     if ((retrying_file_operation
         (read, real_gc_file, ((char *) fixup_buffer),
          (gc_file_start_position + (fixup_count << gc_buffer_byte_shift)),
@@ -320,6 +324,10 @@ next_buffer:
 Boolean
 DEFUN_VOID (reset_fixes)
 {
+#if defined(_SYSV3) && !defined(_HPUX)
+    extern int EXFUN (write, (int, char *, int));
+#endif
+
   long start;
 
   fixup_count += 1;
index d95c210420ca31207106fc53f8bbab31a646046a..bc6539ae2566770ab4312f07fc73ddb03e583c8a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.45 1992/05/04 18:31:22 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.46 1992/06/03 21:54:31 jinx Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -38,13 +38,17 @@ MIT in each case. */
 
 #include "oscond.h"
 #include "gccode.h"
+
 #ifdef _BSD
-#include <sys/file.h>
+#  include <sys/file.h>
 #else
-#include <fcntl.h>
+#  ifndef F_GETFL
+#    include <fcntl.h>
+#  endif
 #endif
+
 #ifndef DOS386
-#include <sys/param.h>
+#  include <sys/param.h>
 #endif
 \f
 #ifndef BCH_START_CLOSURE_RELOCATION