summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-24 15:24:45 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-24 15:24:45 +0000
commitc4c2f7ecc229de0059018aebac1f6a444a382900 (patch)
tree12790ea8cbb28997090d826a6385c4b62bf6f9f7
parent41bfdf710742595e6043d9b851e8dab30ffe6d2f (diff)
downloadhaskell-c4c2f7ecc229de0059018aebac1f6a444a382900.tar.gz
Using 'stdcall' when it is not supported is only a warning now (#3336)
-rw-r--r--compiler/ghci/LibFFI.hsc3
-rw-r--r--compiler/typecheck/TcForeign.lhs3
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/ghci/LibFFI.hsc b/compiler/ghci/LibFFI.hsc
index 9dd2a24021..86714effa4 100644
--- a/compiler/ghci/LibFFI.hsc
+++ b/compiler/ghci/LibFFI.hsc
@@ -53,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
diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs
index d42b37283b..73fd449d32 100644
--- a/compiler/typecheck/TcForeign.lhs
+++ b/compiler/typecheck/TcForeign.lhs
@@ -310,7 +310,8 @@ checkCConv CCallConv = return ()
#if i386_TARGET_ARCH
checkCConv StdCallConv = return ()
#else
-checkCConv StdCallConv = addErrTc (text "calling convention not supported on this platform: stdcall")
+-- This is a warning, not an error. see #3336
+checkCConv StdCallConv = addWarnTc (text "the 'stdcall' calling convention is unsupported on this platform,"$$ text "treating as ccall")
#endif
checkCConv PrimCallConv = addErrTc (text "The `prim' calling convention can only be used with `foreign import'")
checkCConv CmmCallConv = panic "checkCConv CmmCallConv"