[project @ 1997-09-26 14:28:43 by simonpj]
[ghc-hetmet.git] / ghc / compiler / parser / UgenUtil.lhs
index 4b4523f..11f6c59 100644 (file)
@@ -14,19 +14,29 @@ module UgenUtil (
 
 IMP_Ubiq()
 
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
 import PreludeGlaST
+#else
+import GlaExts
+import Name
+#endif
 
-#if __GLASGOW_HASKELL__ >= 200
+#if __GLASGOW_HASKELL__ == 201
 # define ADDR      GHCbase.Addr
 # define PACK_STR   packCString
 # define PACK_BYTES packCBytes
+#elif __GLASGOW_HASKELL >= 202
+# define ADDR       GHC.Addr
+# define PACK_STR   mkFastCharString
+# define PACK_BYTES mkFastCharString2
 #else
 # define ADDR      _Addr
-# define PACK_STR   _packCString
-# define PACK_BYTES _packCBytes
+# define PACK_STR   mkFastCharString
+# define PACK_BYTES mkFastCharString2
 #endif
 
 import RdrHsSyn                ( RdrName(..) )
+import BasicTypes      ( IfaceFlavour )
 import SrcLoc          ( mkSrcLoc, noSrcLoc, SrcLoc )
 \end{code}
 
@@ -85,7 +95,7 @@ rdU_hstring :: ADDR -> UgnM U_hstring
 rdU_hstring x
   = ioToUgnM (_ccall_ get_hstring_len   x)  `thenUgn` \ len ->
     ioToUgnM (_ccall_ get_hstring_bytes x)  `thenUgn` \ bytes ->
-    returnUgn (PACK_BYTES len bytes)
+    returnUgn (PACK_BYTES bytes len)
 \end{code}
 
 \begin{code}