diff options
author | sof <unknown> | 1997-11-24 20:22:28 +0000 |
---|---|---|
committer | sof <unknown> | 1997-11-24 20:22:28 +0000 |
commit | 68345a8f4828f16bd5cb6552247b198bd2919927 (patch) | |
tree | 8b0139a914c61ba84925cc071ae9bd02b36f835e /ghc/compiler/HsVersions.h | |
parent | 472c68ef2073b4bdd8b80320d16a10b4204c8b2f (diff) | |
download | haskell-68345a8f4828f16bd5cb6552247b198bd2919927.tar.gz |
[project @ 1997-11-24 20:22:28 by sof]
New macros added to cope with new defn of ST
Diffstat (limited to 'ghc/compiler/HsVersions.h')
-rw-r--r-- | ghc/compiler/HsVersions.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/ghc/compiler/HsVersions.h b/ghc/compiler/HsVersions.h index 55fedfbf82..77e9a22baa 100644 --- a/ghc/compiler/HsVersions.h +++ b/ghc/compiler/HsVersions.h @@ -46,6 +46,10 @@ you will screw up the layout where they are used in case expressions! # define _runST STbase.runST # define failWith fail # define MkST ST +# define STATE_TOK(x) (S# x) +# define ST_RET(x,y) (x,y) +# define unsafePerformST(x) unsafePerformPrimIO (x) +# define ST_TO_PrimIO(x) x # define MkIOError(h,errt,msg) (errt msg) # define Text Show # define IMP_FASTSTRING() @@ -79,14 +83,30 @@ you will screw up the layout where they are used in case expressions! # define _writeHandle IOHandle.writeHandle # define _newHandle IOHandle.newdHandle # define MkST ST +# if __GLASGOW_HASKELL__ >= 209 +# define STATE_TOK(x) x +# define ST_RET(x,y) STret (y) (x) +# define unsafePerformST(x) runST (x) +# define ST_TO_PrimIO(x) (stToIO (x)) +# else +# define STATE_TOK(x) (S# x) +# define ST_RET(x,y) (x,y) +# define unsafePerformST(x) unsafePerformPrimIO(x) +# define ST_TO_PrimIO(x) x +# endif # define failWith fail # define MkIOError(h,errt,msg) (IOError (Just h) errt msg) # define CCALL_THEN thenIO_Prim # define _filePtr IOHandle.filePtr # define Text Show # define IMP_FASTSTRING() import FastString -# define IMP_Ubiq() import GlaExts ; import FastString -# define CHK_Ubiq() import GlaExts ; import FastString +# if __GLASGOW_HASKELL__ >= 209 +# define IMP_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString +# define CHK_Ubiq() import GlaExts ; import Addr(Addr(..)); import FastString +# else +# define IMP_Ubiq() import GlaExts ; import FastString +# define CHK_Ubiq() import GlaExts ; import FastString +# endif # define minInt (minBound::Int) # define maxInt (maxBound::Int) #else @@ -177,8 +197,10 @@ you will screw up the layout where they are used in case expressions! # define FAST_STRING FastString {-_PackedString -} # if __GLASGOW_HASKELL__ < 200 # define SLIT(x) (mkFastCharString (A# (x#))) -# else +# elif __GLASGOW_HASKELL__ < 209 # define SLIT(x) (mkFastCharString (GlaExts.A# (x#))) +# else +# define SLIT(x) (mkFastCharString (Addr.A# (x#))) # endif # define _CMP_STRING_ cmpPString /* cmpPString defined in utils/Util.lhs */ |