X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FLibFFI.hsc;h=86714effa42f3b4bfc4331719ce2b33190404407;hp=3708238133a2ccd0f5c1344f632406cb4f8333c7;hb=16b9e80dc14db24509f051f294b5b51943285090;hpb=937eb1f1386f12c729c6d819417fe81bc4786b9f diff --git a/compiler/ghci/LibFFI.hsc b/compiler/ghci/LibFFI.hsc index 3708238..86714ef 100644 --- a/compiler/ghci/LibFFI.hsc +++ b/compiler/ghci/LibFFI.hsc @@ -6,12 +6,6 @@ -- ----------------------------------------------------------------------------- -#ifndef USE_LIBFFI - -module LibFFI () where - -#else - #include module LibFFI ( @@ -22,13 +16,12 @@ module LibFFI ( import TyCon import ForeignCall import Panic -import Outputable +-- import Outputable import Constants import Foreign import Foreign.C import Text.Printf -import Control.Exception ---------------------------------------------------------------------------- @@ -51,7 +44,7 @@ prepForeignCall cconv arg_types result_type let res_ty = primRepToFFIType result_type r <- ffi_prep_cif cif abi (fromIntegral n_args) res_ty arg_arr if (r /= fFI_OK) - then throwDyn (InstallationError + then ghcError (InstallationError (printf "prepForeignCallFailed: %d" (show r))) else return cif @@ -60,7 +53,8 @@ convToABI CCallConv = fFI_DEFAULT_ABI #ifdef mingw32_HOST_OS convToABI StdCallConv = fFI_STDCALL #endif -convToABI _ = panic "convToABI: convention not supported" +-- unknown conventions are mapped to the default, (#3336) +convToABI _ = fFI_DEFAULT_ABI -- c.f. DsForeign.primTyDescChar primRepToFFIType :: PrimRep -> Ptr C_ffi_type @@ -142,5 +136,3 @@ foreign import ccall "ffi_prep_cif" -- -> Ptr () -- put result here -- -> Ptr (Ptr ()) -- arg values -- -> IO () - -#endif