From: simonmar Date: Tue, 31 Jul 2001 11:51:09 +0000 (+0000) Subject: [project @ 2001-07-31 11:51:09 by simonmar] X-Git-Tag: nhc98-1-18-release~1214 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ec5b58520e7780219207a6ac246aee961fb8f2ce;p=ghc-base.git [project @ 2001-07-31 11:51:09 by simonmar] Catch up with changes in the main tree. --- diff --git a/cbits/Makefile b/cbits/Makefile index d1c450c..ba63727 100644 --- a/cbits/Makefile +++ b/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/cbits/errno.c b/cbits/errno.c index 0e2d71c..b8e7907 100644 --- a/cbits/errno.c +++ b/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/cbits/inputReady.c b/cbits/inputReady.c index 4cb9908..f928dfa 100644 --- a/cbits/inputReady.c +++ b/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/cbits/system.c b/cbits/system.c index 289499b..0873885 100644 --- a/cbits/system.c +++ b/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/cbits/writeError.c b/cbits/writeError.c index 9f1f192..e4f0247 100644 --- a/cbits/writeError.c +++ b/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) {