[project @ 2005-07-12 14:41:00 by simonmar]
authorsimonmar <unknown>
Tue, 12 Jul 2005 14:41:00 +0000 (14:41 +0000)
committersimonmar <unknown>
Tue, 12 Jul 2005 14:41:00 +0000 (14:41 +0000)
Give a more helpful error message on platforms for which FFI support
isn't implemented in GHCi (namely x86_64 at the moment).

ghc/compiler/ghci/ByteCodeFFI.lhs

index 8c9f249..06c1aa1 100644 (file)
@@ -11,9 +11,11 @@ module ByteCodeFFI ( mkMarshalCode, moan64 ) where
 import Outputable
 import SMRep           ( CgRep(..), cgRepSizeW )
 import ForeignCall     ( CCallConv(..) )
+import Panic
 
 -- DON'T remove apparently unused imports here .. 
 -- there is ifdeffery below
+import Control.Exception ( throwDyn )
 import DATA_BITS       ( Bits(..), shiftR, shiftL )
 import Foreign         ( newArray )
 import Data.List        ( mapAccumL )
@@ -637,7 +639,7 @@ mkMarshalCode_wrk cconv (r_offW, r_rep) addr_offW arg_offs_n_reps
 
 #else 
 
-   = error "mkMarshalCode not implemented for this platform."
+   = throwDyn (InstallationError "foreign import is not implemented for GHCi on this platform.")
 
 #endif