projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove more ifdeffery
[ghc-hetmet.git]
/
compiler
/
utils
/
Util.lhs
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
9537ae1
..
82e0393
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-6,7
+6,8
@@
\begin{code}
module Util (
\begin{code}
module Util (
- debugIsOn,
+ debugIsOn, ghciTablesNextToCode, picIsOn,
+ isWindowsHost, isWindowsTarget, isDarwinTarget,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
-- general list processing
zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal,
@@
-74,8
+75,6
@@
module Util (
Direction(..), reslash,
) where
Direction(..), reslash,
) where
--- XXX This define is a bit of a hack, and should be done more nicely
-#define FAST_STRING_NOT_NEEDED 1
#include "HsVersions.h"
import Panic
#include "HsVersions.h"
import Panic
@@
-108,7
+107,7
@@
infixr 9 `thenCmp`
%************************************************************************
%* *
%************************************************************************
%* *
-\subsection{-DDEBUG}
+\subsection{Is DEBUG on, are we on Windows?}
%* *
%************************************************************************
%* *
%************************************************************************
@@
-119,6
+118,41
@@
debugIsOn = True
#else
debugIsOn = False
#endif
#else
debugIsOn = False
#endif
+
+ghciTablesNextToCode :: Bool
+#ifdef GHCI_TABLES_NEXT_TO_CODE
+ghciTablesNextToCode = True
+#else
+ghciTablesNextToCode = False
+#endif
+
+picIsOn :: Bool
+#ifdef __PIC__
+picIsOn = True
+#else
+picIsOn = False
+#endif
+
+isWindowsHost :: Bool
+#ifdef mingw32_HOST_OS
+isWindowsHost = True
+#else
+isWindowsHost = False
+#endif
+
+isWindowsTarget :: Bool
+#ifdef mingw32_TARGET_OS
+isWindowsTarget = True
+#else
+isWindowsTarget = False
+#endif
+
+isDarwinTarget :: Bool
+#ifdef darwin_TARGET_OS
+isDarwinTarget = True
+#else
+isDarwinTarget = False
+#endif
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-204,7
+238,12
@@
zipWith4Equal msg _ _ _ _ _ = panic ("zipWith4Equal: unequal lists:"++msg)
zipLazy :: [a] -> [b] -> [(a,b)]
zipLazy [] _ = []
zipLazy :: [a] -> [b] -> [(a,b)]
zipLazy [] _ = []
-zipLazy (x:xs) ~(y:ys) = (x,y) : zipLazy xs ys
+-- We want to write this, but with GHC 6.4 we get a warning, so it
+-- doesn't validate:
+-- zipLazy (x:xs) ~(y:ys) = (x,y) : zipLazy xs ys
+-- so we write this instead:
+zipLazy (x:xs) zs = let y : ys = zs
+ in (x,y) : zipLazy xs ys
\end{code}
\end{code}