summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-07-31 11:51:09 +0000
committersimonmar <unknown>2001-07-31 11:51:09 +0000
commit6d51c891e082dc04de0f3563929cda9925d18924 (patch)
tree51013cba9e8f7b0f3ca57167b573c941a9aca228
parentc5175d4c25564f61f6f24811c813b550b5b82e45 (diff)
downloadhaskell-6d51c891e082dc04de0f3563929cda9925d18924.tar.gz
[project @ 2001-07-31 11:51:09 by simonmar]
Catch up with changes in the main tree.
-rw-r--r--libraries/base/cbits/Makefile11
-rw-r--r--libraries/base/cbits/errno.c3
-rw-r--r--libraries/base/cbits/inputReady.c4
-rw-r--r--libraries/base/cbits/system.c13
-rw-r--r--libraries/base/cbits/writeError.c10
5 files changed, 25 insertions, 16 deletions
diff --git a/libraries/base/cbits/Makefile b/libraries/base/cbits/Makefile
index d1c450c52f..ba63727293 100644
--- a/libraries/base/cbits/Makefile
+++ b/libraries/base/cbits/Makefile
@@ -1,15 +1,18 @@
-# $Id: Makefile,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+# $Id: Makefile,v 1.2 2001/07/31 11:51:09 simonmar Exp $
TOP = ../../..
include $(TOP)/mk/boilerplate.mk
-HSLIB = core
+PACKAGE = core
IS_CBITS_LIB = YES
SRC_CC_OPTS += -Wall -DCOMPILING_STDLIB -I../include -I../../../ghc/includes -I../../../ghc/rts
-ifeq "$(DLLized)" "YES"
-SRC_CC_OPTS += -dynamic
+ifeq "$(ILXized)" "YES"
+DLLized = YES
+C_SRCS += $(FPTOOLS_TOP)/ghc/rts/StgPrimFloat.c
+else
+C_SRCS := $(filter-out ilxstubs.c,$(C_SRCS))
endif
# -----------------------------------------------------------------------------
diff --git a/libraries/base/cbits/errno.c b/libraries/base/cbits/errno.c
index 0e2d71cbc2..b8e7907492 100644
--- a/libraries/base/cbits/errno.c
+++ b/libraries/base/cbits/errno.c
@@ -1,7 +1,7 @@
/*
* (c) The University of Glasgow, 2000-2001
*
- * $Id: errno.c,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+ * $Id: errno.c,v 1.2 2001/07/31 11:51:09 simonmar Exp $
*
* GHC Error Number Conversion
*/
@@ -9,6 +9,7 @@
#include "HsCore.h"
/* Raw errno */
+/* Covers up the fact that on Windows this is a function */
int *ghcErrno(void) {
return &errno;
diff --git a/libraries/base/cbits/inputReady.c b/libraries/base/cbits/inputReady.c
index 4cb9908617..f928dfa0b5 100644
--- a/libraries/base/cbits/inputReady.c
+++ b/libraries/base/cbits/inputReady.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: inputReady.c,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+ * $Id: inputReady.c,v 1.2 2001/07/31 11:51:09 simonmar Exp $
*
* hReady Runtime Support
*/
@@ -21,8 +21,8 @@
int
inputReady(int fd, int msecs)
{
- int maxfd, ready;
#ifndef mingw32_TARGET_OS
+ int maxfd, ready;
fd_set rfd;
struct timeval tv;
#endif
diff --git a/libraries/base/cbits/system.c b/libraries/base/cbits/system.c
index 289499bf26..0873885c60 100644
--- a/libraries/base/cbits/system.c
+++ b/libraries/base/cbits/system.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
- * $Id: system.c,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+ * $Id: system.c,v 1.2 2001/07/31 11:51:09 simonmar Exp $
*
* system Runtime Support
*/
@@ -18,6 +18,7 @@
HsInt
systemCmd(HsAddr cmd)
{
+ /* -------------------- WINDOWS VERSION --------------------- */
#if defined(mingw32_TARGET_OS)
STARTUPINFO sInfo;
PROCESS_INFORMATION pInfo;
@@ -31,14 +32,22 @@ systemCmd(HsAddr cmd)
sInfo.lpTitle = NULL;
sInfo.dwFlags = 0;
- if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo))
+ if (!CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &sInfo, &pInfo))
+ /* The 'TRUE' says that the created process should share
+ handles with the current process. This is vital to ensure
+ that error messages sent to stderr actually appear on the screen.
+ Since we are going to wait for the process to terminate anyway,
+ there is no problem with such sharing. */
+
return -1;
WaitForSingleObject(pInfo.hProcess, INFINITE);
if (GetExitCodeProcess(pInfo.hProcess, &retCode) == 0) return -1;
CloseHandle(pInfo.hProcess);
CloseHandle(pInfo.hThread);
return retCode;
+
#else
+ /* -------------------- UNIX VERSION --------------------- */
int pid;
int wstat;
diff --git a/libraries/base/cbits/writeError.c b/libraries/base/cbits/writeError.c
index 9f1f1924fe..e4f0247388 100644
--- a/libraries/base/cbits/writeError.c
+++ b/libraries/base/cbits/writeError.c
@@ -1,7 +1,7 @@
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1998
*
- * $Id: writeError.c,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+ * $Id: writeError.c,v 1.2 2001/07/31 11:51:09 simonmar Exp $
*
* hPutStr Runtime Support
*/
@@ -20,12 +20,6 @@ implementation in one or two places.)
#include "RtsUtils.h"
#include "HsCore.h"
-HsAddr
-addrOf_ErrorHdrHook(void)
-{
- return &ErrorHdrHook;
-}
-
void
writeErrString__ (HsAddr msg_hdr, HsAddr msg, HsInt len)
{
@@ -33,7 +27,9 @@ writeErrString__ (HsAddr msg_hdr, HsAddr msg, HsInt len)
char* p = (char*)msg;
char nl = '\n';
+#ifndef DLLized
resetNonBlockingFd(2);
+#endif
/* Print error msg header */
if (msg_hdr) {