summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonpj <unknown>2003-02-24 12:39:27 +0000
committersimonpj <unknown>2003-02-24 12:39:27 +0000
commit395917a05328e935f40abd080b169aa25546b083 (patch)
treeac80055ad5babbee9632343f1ac1ac88140416bb /ghc
parent384d5bcf83b6e7ee103fca364ca1ab6ef831834a (diff)
downloadhaskell-395917a05328e935f40abd080b169aa25546b083.tar.gz
[project @ 2003-02-24 12:39:24 by simonpj]
Three Template Haskell improvements a) Add type synonyms to THSyntax (and DsMeta, Convert) b) Make Q into a newtype instead of a type synonym c) Eliminate tiresome and error prone argument to DsMeta.wrapGenSyms and similarly addTyVarBinds
Diffstat (limited to 'ghc')
-rw-r--r--ghc/compiler/ghci/InteractiveUI.hs8
-rw-r--r--ghc/compiler/main/DriverFlags.hs4
-rw-r--r--ghc/compiler/main/DriverPhases.hs4
-rw-r--r--ghc/compiler/main/SysTools.lhs22
-rw-r--r--ghc/compiler/utils/Panic.lhs6
5 files changed, 23 insertions, 21 deletions
diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs
index ab52f347a0..b8f75deddf 100644
--- a/ghc/compiler/ghci/InteractiveUI.hs
+++ b/ghc/compiler/ghci/InteractiveUI.hs
@@ -1,6 +1,6 @@
{-# OPTIONS -#include "Linker.h" #-}
-----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.147 2003/02/20 13:12:40 simonpj Exp $
+-- $Id: InteractiveUI.hs,v 1.148 2003/02/24 12:39:26 simonpj Exp $
--
-- GHC Interactive User Interface
--
@@ -45,7 +45,7 @@ import CmdLineOpts ( DynFlag(..), DynFlags(..), getDynFlags, saveDynFlags,
import Panic hiding ( showException )
import Config
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
import System.Posix
#endif
@@ -234,7 +234,7 @@ runGHCi paths dflags = do
loadModule paths
-- enter the interactive loop
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
-- always show prompt, since hIsTerminalDevice returns True for Consoles
-- only, which we may or may not be running under (cf. Emacs sub-shells.)
interactiveLoop True
@@ -274,7 +274,7 @@ interactiveLoop is_tty = do
checkPerms :: String -> IO Bool
checkPerms name =
-#ifdef mingw32_TARGET_OS
+#ifdef mingw32_HOST_OS
return True
#else
DriverUtil.handle (\_ -> return False) $ do
diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs
index a015de2328..e66f718ae5 100644
--- a/ghc/compiler/main/DriverFlags.hs
+++ b/ghc/compiler/main/DriverFlags.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.113 2003/02/21 13:26:58 simonpj Exp $
+-- $Id: DriverFlags.hs,v 1.114 2003/02/24 12:39:26 simonpj Exp $
--
-- Driver flags
--
@@ -362,7 +362,7 @@ dynamic_flags = [
-- on all other systems, quoting is necessary, to avoid interpretation
-- of shell metacharacters in the arguments (e.g. green-card's
-- -DBEGIN_GHC_ONLY='}-' trick).
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
, ( "D", Prefix (\s -> addOpt_P ("-D'"++s++"'") ) )
, ( "U", Prefix (\s -> addOpt_P ("-U'"++s++"'") ) )
#else
diff --git a/ghc/compiler/main/DriverPhases.hs b/ghc/compiler/main/DriverPhases.hs
index 4632babb98..e85bbe7ad6 100644
--- a/ghc/compiler/main/DriverPhases.hs
+++ b/ghc/compiler/main/DriverPhases.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverPhases.hs,v 1.22 2002/09/13 15:02:34 simonpj Exp $
+-- $Id: DriverPhases.hs,v 1.23 2003/02/24 12:39:27 simonpj Exp $
--
-- GHC Driver
--
@@ -106,6 +106,8 @@ cish_suffix = (`elem` [ "c", "cpp", "C", "cc", "cxx", "s", "S" ])
hsbootish_suffix = (`elem` [ "hs-boot" ])
extcoreish_suffix = (`elem` [ "hcr" ])
+-- Use the appropriate suffix for the system on which
+-- the GHC-compiled code will run
#if mingw32_TARGET_OS || cygwin32_TARGET_OS
objish_suffix = (`elem` [ "o", "O", "obj", "OBJ" ])
#else
diff --git a/ghc/compiler/main/SysTools.lhs b/ghc/compiler/main/SysTools.lhs
index 15d5c88b77..71b729838f 100644
--- a/ghc/compiler/main/SysTools.lhs
+++ b/ghc/compiler/main/SysTools.lhs
@@ -86,11 +86,11 @@ import Directory ( doesFileExist, removeFile )
-- GHC <= 4.08 didn't have rawSystem, and runs into problems with long command
-- lines on mingw32, so we disallow it now.
-#if defined(mingw32_TARGET_OS) && (__GLASGOW_HASKELL__ <= 408)
+#if defined(mingw32_HOST_OS) && (__GLASGOW_HASKELL__ <= 408)
#error GHC <= 4.08 is not supported for bootstrapping GHC on i386-unknown-mingw32
#endif
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
#if __GLASGOW_HASKELL__ > 504
import qualified GHC.Posix
#else
@@ -103,7 +103,7 @@ import Foreign
import CString ( CString, peekCString )
#endif
-#ifdef mingw32_TARGET_OS
+#ifdef mingw32_HOST_OS
#if __GLASGOW_HASKELL__ > 504
import System.Cmd ( rawSystem )
#else
@@ -272,7 +272,7 @@ initSysTools minusB_args
| am_installed = installed_bin cGHC_MANGLER_PGM
| otherwise = inplace cGHC_MANGLER_DIR_REL cGHC_MANGLER_PGM
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
-- check whether TMPDIR is set in the environment
; IO.try (do dir <- getEnv "TMPDIR" -- fails if not set
setTmpDir dir
@@ -314,7 +314,7 @@ initSysTools minusB_args
throwDyn (InstallationError
("Can't find package.conf as " ++ pkgconfig_path))
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
-- WINDOWS-SPECIFIC STUFF
-- On Windows, gcc and friends are distributed with GHC,
-- so when "installed" we look in TopDir/bin
@@ -417,7 +417,7 @@ initSysTools minusB_args
; return ()
}
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
foreign import stdcall "GetTempPathA" unsafe getTempPath :: Int -> CString -> IO Int32
#endif
\end{code}
@@ -701,7 +701,7 @@ runSomething :: String -- For -v message
runSomething phase_name pgm args
= traceCmd phase_name cmd_line $
do {
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
exit_code <- system cmd_line
#else
exit_code <- rawSystem cmd_line
@@ -772,7 +772,7 @@ pgmPath :: String -- Directory string in Unix format
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
--------------------- Windows version ------------------
dosifyPaths xs = map dosifyPath xs
@@ -832,7 +832,7 @@ slash s1 s2 = s1 ++ ('/' : s2)
-----------------------------------------------------------------------------
-- Define getExecDir :: IO (Maybe String)
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
getExecDir :: IO (Maybe String)
getExecDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32.
buf <- mallocArray len
@@ -849,7 +849,7 @@ foreign import stdcall "GetModuleFileNameA" unsafe
getExecDir :: IO (Maybe String) = do return Nothing
#endif
-#ifdef mingw32_TARGET_OS
+#ifdef mingw32_HOST_OS
foreign import ccall "_getpid" unsafe getProcessID :: IO Int -- relies on Int == Int32 on Windows
#elif __GLASGOW_HASKELL__ > 504
getProcessID :: IO Int
@@ -860,7 +860,7 @@ getProcessID = Posix.getProcessID
#endif
quote :: String -> String
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
quote "" = ""
quote s = "\"" ++ s ++ "\""
#else
diff --git a/ghc/compiler/utils/Panic.lhs b/ghc/compiler/utils/Panic.lhs
index f07f7f1913..29e99e9629 100644
--- a/ghc/compiler/utils/Panic.lhs
+++ b/ghc/compiler/utils/Panic.lhs
@@ -27,7 +27,7 @@ module Panic
import Config
import FastTypes
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
# if __GLASGOW_HASKELL__ > 504
import System.Posix.Signals
# else
@@ -41,7 +41,7 @@ import EXCEPTION ( raiseInThread )
# else
import EXCEPTION ( throwTo )
# endif /* GHC < 500 */
-#endif /* mingw32_TARGET_OS */
+#endif /* mingw32_HOST_OS */
import DYNAMIC
import qualified EXCEPTION as Exception
@@ -185,7 +185,7 @@ thread.
\begin{code}
installSignalHandlers :: IO ()
installSignalHandlers = do
-#ifndef mingw32_TARGET_OS
+#ifndef mingw32_HOST_OS
main_thread <- myThreadId
let sig_handler = Catch (throwTo main_thread
(Exception.DynException (toDyn Interrupted)))