summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2009-06-08 14:55:09 +0000
committerDuncan Coutts <duncan@well-typed.com>2009-06-08 14:55:09 +0000
commit8e0adc0215ff3e6e4c972f9ed6ba9df2f5d2c4f9 (patch)
treea315690f4487477df1a4d21849d18884f0906452 /compiler
parenta0f529668437c84f2aaf744b5abc373de9e264e4 (diff)
downloadhaskell-8e0adc0215ff3e6e4c972f9ed6ba9df2f5d2c4f9.tar.gz
Check we're not using stdcall in foreign export on unsupported platforms
It's already checked for foreign import, but was missing for export.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/typecheck/TcForeign.lhs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs
index 185e592417..aa40d02cd2 100644
--- a/compiler/typecheck/TcForeign.lhs
+++ b/compiler/typecheck/TcForeign.lhs
@@ -243,8 +243,9 @@ tcFExport d = pprPanic "tcFExport" (ppr d)
\begin{code}
tcCheckFEType :: Type -> ForeignExport -> TcM ()
-tcCheckFEType sig_ty (CExport (CExportStatic str _)) = do
+tcCheckFEType sig_ty (CExport (CExportStatic str cconv)) = do
check (isCLabelString str) (badCName str)
+ checkCConv cconv
checkForeignArgs isFFIExternalTy arg_tys
checkForeignRes nonIOok isFFIExportResultTy res_ty
where
@@ -341,7 +342,7 @@ checkCConv CCallConv = return ()
#if i386_TARGET_ARCH
checkCConv StdCallConv = return ()
#else
-checkCConv StdCallConv = addErrTc (text "calling convention not supported on this architecture: stdcall")
+checkCConv StdCallConv = addErrTc (text "calling convention not supported on this platform: stdcall")
#endif
checkCConv CmmCallConv = panic "checkCConv CmmCallConv"
\end{code}