From 10e0d7ac039f06b93bf3f3317756e59b7748f419 Mon Sep 17 00:00:00 2001 From: "Henry M. Wu" Date: Sat, 29 Feb 1992 19:39:41 +0000 Subject: [PATCH] Added DOS 386/486 support. --- v7/src/microcode/bchdmp.c | 36 +++++++++++++++++++++++++++++++----- v7/src/microcode/bchdrn.h | 4 +++- v7/src/microcode/bchgcc.h | 4 +++- v7/src/microcode/bchutl.c | 9 ++++++++- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/v7/src/microcode/bchdmp.c b/v7/src/microcode/bchdmp.c index 1d5e93cdc..70567605d 100644 --- a/v7/src/microcode/bchdmp.c +++ b/v7/src/microcode/bchdmp.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.60 1992/02/10 13:53:22 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.61 1992/02/29 19:33:03 mhwu Exp $ Copyright (c) 1987-1992 Massachusetts Institute of Technology @@ -38,15 +38,43 @@ MIT in each case. */ #include "scheme.h" #include "prims.h" -#include "uxio.h" #include "osfile.h" #include "trap.h" #include "lookup.h" /* UNCOMPILED_VARIABLE */ #define In_Fasdump #include "bchgcc.h" #include "fasl.h" + + +#ifdef DOS386 +#include "msdos.h" +#include "dosio.h" + +int +DEFUN (ftruncate, (fd, size), int fd AND unsigned long size) +{ + return size; +} + +void +DEFUN (mktemp, (fname), unsigned char * fname) +{ /* Should call tmpname */ + return; +} + +#define FASDUMP_FILENAME "\\tmp\\fasdump.bin" + +#else + #include "ux.h" +#include "uxio.h" +extern int EXFUN (unlink, (CONST char *)); +#define FASDUMP_FILENAME "/tmp/fasdumpXXXXXX" + +#endif /* DOS386 */ + + static Tchannel dump_channel; #define Write_Data(size, buffer) \ @@ -244,8 +272,6 @@ DEFUN (fasdump_exit, (length), long length) if (length == 0) { - extern int EXFUN (unlink, (CONST char *)); - (void) (unlink (dump_file_name)); } dump_file_name = ((char *) NULL); @@ -775,7 +801,7 @@ DEFINE_PRIMITIVE ("PRIMITIVE-FASDUMP", Prim_prim_fasdump, 3, 3, 0) Tchannel channel, temp_channel; char temp_name [19]; { - char * scan1 = "/tmp/fasdumpXXXXXX"; + char * scan1 = FASDUMP_FILENAME; char * scan2 = temp_name; while (1) if (((*scan2++) = (*scan1++)) == '\0') diff --git a/v7/src/microcode/bchdrn.h b/v7/src/microcode/bchdrn.h index e32fd81a9..06c5b82bd 100644 --- a/v7/src/microcode/bchdrn.h +++ b/v7/src/microcode/bchdrn.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdrn.h,v 1.2 1991/11/04 16:53:08 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdrn.h,v 1.3 1992/02/29 19:35:23 mhwu Exp $ Copyright (c) 1991 Massachusetts Institute of Technology @@ -46,9 +46,11 @@ MIT in each case. */ #if defined(_POSIX) || defined(_SUNOS4) # include #else +#ifndef DOS386 extern int EXFUN (read, (int, PTR, unsigned int)); extern int EXFUN (write, (int, PTR, unsigned int)); #endif +#endif #if defined(HAVE_POSIX_SIGNALS) && defined(HAVE_BSD_SIGNALS) # define RE_INSTALL_HANDLER(signum,handler) do { } while (0) diff --git a/v7/src/microcode/bchgcc.h b/v7/src/microcode/bchgcc.h index ff5a1be50..287d11f40 100644 --- a/v7/src/microcode/bchgcc.h +++ b/v7/src/microcode/bchgcc.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.43 1992/02/10 13:52:43 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.44 1992/02/29 19:36:55 mhwu Exp $ Copyright (c) 1987-1992 Massachusetts Institute of Technology @@ -43,7 +43,9 @@ MIT in each case. */ #else #include #endif +#ifndef DOS386 #include +#endif extern char * EXFUN (error_name, (int)); diff --git a/v7/src/microcode/bchutl.c b/v7/src/microcode/bchutl.c index d134d5833..168ed0984 100644 --- a/v7/src/microcode/bchutl.c +++ b/v7/src/microcode/bchutl.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchutl.c,v 1.1 1991/10/29 22:35:01 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchutl.c,v 1.2 1992/02/29 19:39:41 mhwu Exp $ Copyright (c) 1991 Massachusetts Institute of Technology @@ -33,7 +33,14 @@ promotional, or sales literature without prior written consent from MIT in each case. */ #include +#ifndef EINTR +#define EINTR 1999 +#endif + +#ifndef DOS386 #include +#endif + #include "ansidecl.h" extern char * EXFUN (error_name, (int)); -- 2.25.1