From 91a5556d3b60552f3815323f99cb5f3e945b4ae6 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Tue, 14 Mar 2000 01:52:25 +0000
Subject: [PATCH] [project @ 2000-03-14 01:52:25 by sof] Misc Win32 bitrot

---
 ghc/lib/std/Makefile          | 2 +-
 ghc/lib/std/PrelIOBase.lhs    | 7 ++++---
 ghc/lib/std/cbits/Makefile    | 6 +++---
 ghc/lib/std/cbits/closeFile.c | 3 ++-
 ghc/lib/std/cbits/progargs.c  | 5 +----
 5 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/ghc/lib/std/Makefile b/ghc/lib/std/Makefile
index 51b68d23a265..e01d7c28b307 100644
--- a/ghc/lib/std/Makefile
+++ b/ghc/lib/std/Makefile
@@ -114,7 +114,7 @@ ifeq "$(way)" "dll"
 PrelMain.dll_o : PrelMain.lhs
 	$(RM) ../PrelMain.lhs
 	$(CP) PrelMain.lhs ../
-	$(MAKE) -C .. PrelMain.dll_o way=dll HC_OPTS="$(filter-out -fcompiling-prelude, $(HC_OPTS))"
+	$(MAKE) -C .. PrelMain.dll_o way=dll HC=std/$(GHC_INPLACE) HC_OPTS="$(filter-out -fcompiling-prelude, $(HC_OPTS))"
 	$(MV) ../PrelMain.dll_o .
 	$(RM) ../PrelMain.lhs ../PrelMain.dll_hi
 endif
diff --git a/ghc/lib/std/PrelIOBase.lhs b/ghc/lib/std/PrelIOBase.lhs
index 9f8aa77b6983..c99197f29316 100644
--- a/ghc/lib/std/PrelIOBase.lhs
+++ b/ghc/lib/std/PrelIOBase.lhs
@@ -1,5 +1,5 @@
 % -----------------------------------------------------------------------------
-% $Id: PrelIOBase.lhs,v 1.17 2000/01/30 10:11:32 simonmar Exp $
+% $Id: PrelIOBase.lhs,v 1.18 2000/03/14 01:52:25 sof Exp $
 % 
 % (c) The AQUA Project, Glasgow University, 1994-1998
 %
@@ -12,6 +12,7 @@ concretely; the @IO@ module itself exports abstractly.
 \begin{code}
 {-# OPTIONS -fno-implicit-prelude -#include "cbits/stgio.h" #-}
 #include "cbits/stgerror.h"
+#include "config.h"
 
 #ifndef __HUGS__ /* Hugs just includes this in PreludeBuiltin so no header needed */
 module PrelIOBase where
@@ -174,7 +175,7 @@ data IOErrorType
   | TimeExpired          | UnsatisfiedConstraints
   | UnsupportedOperation | UserError
   | EOF
-#ifdef _WIN32
+#if defined(cygwin32_TARGET_OS) || defined(mingw32_TARGET_OS)
   | ComError Int           -- HRESULT
 #endif
   deriving (Eq)
@@ -202,7 +203,7 @@ instance Show IOErrorType where
       UserError         -> "failed"
       UnsupportedOperation -> "unsupported operation"
       EOF		-> "end of file"
-#ifdef _WIN32
+#if defined(cygwin32_TARGET_OS) || defined(mingw32_TARGET_OS)
       ComError _	-> "COM error"
 #endif
 
diff --git a/ghc/lib/std/cbits/Makefile b/ghc/lib/std/cbits/Makefile
index 38549e7c63f8..68d965ed1715 100644
--- a/ghc/lib/std/cbits/Makefile
+++ b/ghc/lib/std/cbits/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.12 1999/12/08 15:47:07 simonmar Exp $
+# $Id: Makefile,v 1.13 2000/03/14 01:52:25 sof Exp $
 
 TOP = ../../..
 include $(TOP)/mk/boilerplate.mk
@@ -28,7 +28,7 @@ $(DLL_NAME) : DllVersionInfo.o
 endif
 
 DLL_NAME = HScbits.dll
-DLL_IMPLIB_NAME = libHScbits_imp.a
+DLL_IMPLIB_NAME = libHS_cbits_imp.a
 DLL_DESCRIPTION = "Haskell Prelude helpers"
 SRC_BLD_DLL_OPTS += --export-all --output-def=HScbits.def DllVersionInfo.o
 SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lgmp -L. -L../../../rts/gmp -L../../../rts
@@ -36,7 +36,7 @@ SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lgmp -L. -L../../../rts/gmp -
 #
 # Compile the files using the Haskell compiler (ghc really).
 # 
-# CC=$(GHC_INPLACE)
+CC=$(GHC_INPLACE)
 
 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
 
diff --git a/ghc/lib/std/cbits/closeFile.c b/ghc/lib/std/cbits/closeFile.c
index 1addd3f3ddba..f144c41eaa0c 100644
--- a/ghc/lib/std/cbits/closeFile.c
+++ b/ghc/lib/std/cbits/closeFile.c
@@ -1,13 +1,14 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: closeFile.c,v 1.7 1999/11/25 16:54:14 simonmar Exp $
+ * $Id: closeFile.c,v 1.8 2000/03/14 01:52:25 sof Exp $
  *
  * hClose Runtime Support
  */
 
 #include "Rts.h"
 #include "stgio.h"
+#include <errno.h>
 
 #if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
 #define USE_WINSOCK
diff --git a/ghc/lib/std/cbits/progargs.c b/ghc/lib/std/cbits/progargs.c
index c4519d684a2a..30d89aa3c50a 100644
--- a/ghc/lib/std/cbits/progargs.c
+++ b/ghc/lib/std/cbits/progargs.c
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: progargs.c,v 1.2 1999/03/02 20:14:01 sof Exp $
+ * $Id: progargs.c,v 1.3 2000/03/14 01:52:25 sof Exp $
  *
  * System.getArgs Runtime Support
  */
@@ -9,9 +9,6 @@
 #include "Rts.h"
 #include "stgio.h"
 
-DLLIMPORT extern char** prog_argv;
-DLLIMPORT extern int prog_argc;
-
 StgAddr
 get_prog_argv(void)
 { 
-- 
GitLab