From 68345a8f4828f16bd5cb6552247b198bd2919927 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 24 Nov 1997 20:22:28 +0000 Subject: [PATCH] [project @ 1997-11-24 20:22:28 by sof] New macros added to cope with new defn of ST --- ghc/compiler/HsVersions.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/HsVersions.h b/ghc/compiler/HsVersions.h index 55fedfb..77e9a22 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 */ -- 1.7.10.4