From: Chris Hanson <org/chris-hanson/cph>
Date: Sun, 29 Jan 2006 06:37:30 +0000 (+0000)
Subject: Changes that allow compilation with Open Watcom 1.4.
X-Git-Tag: 20090517-FFI~1124
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b0915d4d9d2fdc2f8b1f3ba4b54710b98bd67f30;p=mit-scheme.git

Changes that allow compilation with Open Watcom 1.4.
---

diff --git a/v7/src/microcode/cmpint.c b/v7/src/microcode/cmpint.c
index 137fbb4b2..a5f2dec9a 100644
--- a/v7/src/microcode/cmpint.c
+++ b/v7/src/microcode/cmpint.c
@@ -1,10 +1,10 @@
 /* -*-C-*-
 
-$Id: cmpint.c,v 1.103 2004/11/19 04:18:44 cph Exp $
+$Id: cmpint.c,v 1.104 2006/01/29 06:37:30 cph Exp $
 
 Copyright 1989,1990,1991,1992,1993,1994 Massachusetts Institute of Technology
 Copyright 1995,1996,2000,2001,2002,2003 Massachusetts Institute of Technology
-Copyright 2004 Massachusetts Institute of Technology
+Copyright 2004,2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -192,7 +192,11 @@ typedef char instruction;
 #  define VARENTRY(name) instruction * name
 #  define EXTENTRY(name) extern instruction * name
 #else
-#  define REFENTRY(name) ((void EXFUN ((*), (void))) name)
+#  ifdef __OPEN_WATCOM_14__
+#    define REFENTRY(name) ((void *) name)
+#  else
+#    define REFENTRY(name) ((void EXFUN ((*), (void))) name)
+#  endif
 #  define VARENTRY(name) void EXFUN ((*name), (void))
 #  define EXTENTRY(name) extern void EXFNX (name, (void))
 #endif
diff --git a/v7/src/microcode/ntscreen.c b/v7/src/microcode/ntscreen.c
index 3b322b851..4b1ba886b 100644
--- a/v7/src/microcode/ntscreen.c
+++ b/v7/src/microcode/ntscreen.c
@@ -1,9 +1,9 @@
 /* -*-C-*-
 
-$Id: ntscreen.c,v 1.51 2004/01/31 02:16:53 cph Exp $
+$Id: ntscreen.c,v 1.52 2006/01/29 06:37:30 cph Exp $
 
 Copyright 1993,1996,1997,1998,1999,2000 Massachusetts Institute of Technology
-Copyright 2002,2004 Massachusetts Institute of Technology
+Copyright 2002,2004,2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -601,7 +601,7 @@ ScreenWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
        return  (LRESULT)ReadScreen (screen, (LPSTR)lParam, (int)wParam);
 
      case SCREEN_SETMENU:
-       Screen_SetMenu (hWnd, (HMENU)lParam);
+       Screen_SetMenu (screen, (HMENU)lParam);
        return  0L;
 
      case SCREEN_CLEAR:
@@ -3643,7 +3643,7 @@ search_for_font (LOGFONT * lf)
   (args . foundp) = FALSE;
   (void) EnumFontFamilies (hdc,
 			   (lf -> lfFaceName),
-			   search_for_font_proc,
+			   ((void *) search_for_font_proc),
 			   ((LPARAM) (&args)));
   if (args . foundp)
     (*lf) = (args . elf . elfLogFont);
diff --git a/v7/src/microcode/ntscreen.h b/v7/src/microcode/ntscreen.h
index be24a6ff7..f7ce5fb67 100644
--- a/v7/src/microcode/ntscreen.h
+++ b/v7/src/microcode/ntscreen.h
@@ -1,8 +1,9 @@
 /* -*-C-*-
 
-$Id: ntscreen.h,v 1.22 2003/02/14 18:28:21 cph Exp $
+$Id: ntscreen.h,v 1.23 2006/01/29 06:37:30 cph Exp $
 
-Copyright (c) 1993-2000 Massachusetts Institute of Technology
+Copyright 1993,1994,1995,1996,1997,1998 Massachusetts Institute of Technology
+Copyright 1999,2000,2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -267,10 +268,10 @@ extern void Screen_WriteChar (HANDLE, char);
 extern void Screen_WriteText (HANDLE, char*);
 extern int  Screen_Read (HANDLE, BOOL, char *, int);
 extern void Screen_SetCursorPosition (HANDLE, int line, int column);
-extern void Screen_SetMenu (HANDLE, HMENU);
+extern void Screen_SetMenu (SCREEN, HMENU);
 extern void Screen_SetMode (HANDLE, int);
 extern int  Screen_GetMode (HANDLE);
-extern VOID Screen_GetSize (HANDLE, int *rows, int *columns);
+extern VOID Screen_GetSize (HWND, int *rows, int *columns);
 extern void screen_char_dimensions (HWND, int *, int *);
 
 /* The following return zero iff no events */
diff --git a/v7/src/microcode/ntsock.c b/v7/src/microcode/ntsock.c
index a24e2b9c3..a49c2447a 100644
--- a/v7/src/microcode/ntsock.c
+++ b/v7/src/microcode/ntsock.c
@@ -1,8 +1,9 @@
 /* -*-C-*-
 
-$Id: ntsock.c,v 1.18 2003/07/12 03:39:29 cph Exp $
+$Id: ntsock.c,v 1.19 2006/01/29 06:37:30 cph Exp $
 
 Copyright 1997,1998,1999,2001,2002,2003 Massachusetts Institute of Technology
+Copyright 2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -233,7 +234,7 @@ OS_listen_tcp_server_socket (Tchannel channel)
 
 Tchannel
 OS_server_connection_accept (Tchannel channel,
-			     char * peer_host, unsigned int * peer_port)
+			     void * peer_host, unsigned int * peer_port)
 {
   static struct sockaddr_in address;
   SOCKET s;
diff --git a/v7/src/microcode/nttop.c b/v7/src/microcode/nttop.c
index 212dd413c..8dc14c0ec 100644
--- a/v7/src/microcode/nttop.c
+++ b/v7/src/microcode/nttop.c
@@ -1,8 +1,9 @@
 /* -*-C-*-
 
-$Id: nttop.c,v 1.35 2004/03/09 06:26:50 cph Exp $
+$Id: nttop.c,v 1.36 2006/01/29 06:37:30 cph Exp $
 
 Copyright 1993,1997,1998,2000,2003,2004 Massachusetts Institute of Technology
+Copyright 2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -478,13 +479,14 @@ OS_restore_external_state (void)
   return;
 }
 
+#ifndef __OPEN_WATCOM_14__
 void 
 bcopy (const char * s1, char * s2, int n)
 {
   while (n-- > 0)
     *s2++ = *s1++;
-  return;
 }
+#endif
 
 void *
 OS_malloc (unsigned int size)
diff --git a/v7/src/microcode/nttrap.c b/v7/src/microcode/nttrap.c
index 7163a50ef..8b84b9d51 100644
--- a/v7/src/microcode/nttrap.c
+++ b/v7/src/microcode/nttrap.c
@@ -1,8 +1,9 @@
 /* -*-C-*-
 
-$Id: nttrap.c,v 1.26 2003/02/14 18:48:12 cph Exp $
+$Id: nttrap.c,v 1.27 2006/01/29 06:37:30 cph Exp $
 
-Copyright 1992-2002 Massachusetts Institute of Technology
+Copyright 1993,1997,1998,2000,2001,2002 Massachusetts Institute of Technology
+Copyright 2006 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -32,6 +33,10 @@ USA.
 #include "ntscmlib.h"
 #include <windows.h>
 
+#ifdef __OPEN_WATCOM_14__
+#  include <excpt.h>
+#endif
+
 #ifdef W32_TRAP_DEBUG
 extern char * AskUser (char *, int);
 extern int EXFUN (TellUser, (char *, ...));
diff --git a/v7/src/microcode/ntutl/config.h b/v7/src/microcode/ntutl/config.h
index 4ab9c49aa..ace924316 100644
--- a/v7/src/microcode/ntutl/config.h
+++ b/v7/src/microcode/ntutl/config.h
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: config.h,v 1.7 2003/07/22 02:19:51 cph Exp $
+$Id: config.h,v 1.8 2006/01/29 06:37:30 cph Exp $
 
 Copyright 2000,2001,2003 Massachusetts Institute of Technology
 
@@ -34,6 +34,10 @@ USA.
 #  define CL386
 #endif
 
+#if defined (__WATCOMC__) && (__WATCOMC__ >= 1240)
+#  define __OPEN_WATCOM_14__
+#endif
+
 #include <sys/types.h>
 #include <time.h>
 
@@ -43,12 +47,15 @@ typedef _off_t off_t;
 typedef short nlink_t;
 #endif
 
-typedef unsigned short mode_t;
-typedef unsigned long pid_t;
-typedef short uid_t;
-typedef short gid_t;
+#ifndef __OPEN_WATCOM_14__
+  typedef unsigned short mode_t;
+  typedef unsigned long pid_t;
+  typedef short uid_t;
+  typedef short gid_t;
+  typedef long ssize_t;
+#endif
+
 typedef unsigned char cc_t;
-typedef long ssize_t;
 
 /* The number of bytes in a unsigned long.  */
 #define SIZEOF_UNSIGNED_LONG 4
diff --git a/v7/src/microcode/ntutl/makefile.wcc b/v7/src/microcode/ntutl/makefile.wcc
index 36053d356..a0cce7e00 100644
--- a/v7/src/microcode/ntutl/makefile.wcc
+++ b/v7/src/microcode/ntutl/makefile.wcc
@@ -1,9 +1,9 @@
 ### -*- Fundamental -*-
 ###
-###     $Id: makefile.wcc,v 1.20 2003/07/22 02:19:51 cph Exp $
+###     $Id: makefile.wcc,v 1.21 2006/01/29 06:37:30 cph Exp $
 ###
 ###     Copyright 1995,1996,1997,1999 Massachusetts Institute of Technology
-###     Copyright 2000,2001,2003 Massachusetts Institute of Technology
+###     Copyright 2000,2001,2003,2006 Massachusetts Institute of Technology
 ###
 ###     This file is part of MIT/GNU Scheme.
 ###
@@ -26,9 +26,9 @@
 #### Makefile for Scheme under Win32 compiled by Watcom C/C++
 ###  This makefile is meant to be used with Watcom make.
 
-#USER_PRIM_SOURCES = prbfish.c prgdbm.c prmd5.c prpgsql.c
-#USER_PRIM_OBJECTS = prbfish.obj prgdbm.obj prmd5.obj prpgsql.obj
-#USER_LIBS = library blowfish.lib,gdbm.lib,md5.lib,pq.lib
+USER_PRIM_SOURCES = prbfish.c prgdbm.c prmd5.c # prpgsql.c
+USER_PRIM_OBJECTS = prbfish.obj prgdbm.obj prmd5.obj # prpgsql.obj
+USER_LIBS = library wsock32.lib,blowfish.lib,gdbm.lib,md5.lib # ,pq.lib
 
 CC = wcc386
 M4 = m4
@@ -98,9 +98,10 @@ M4FLAGS = -DWIN32 -DWCC386R
 # /d1		generate debug info
 # /fpi		generate in-line 387 insns, emulate if none
 # /fp3		generate in-line 387 insns
+# /5p		generate code for 586 in protected mode
 # /mf		use flat memory model
 # /zq		operate quietly
-ASFLAGS = /bt=nt /d1 /fpi /fp3 /mf /zq
+ASFLAGS = /bt=nt /d1 /fpi /fp3 /5p /mf /zq
 
 # Library Manager options.
 #