projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check we're not using stdcall in foreign export on unsupported platforms
[ghc-hetmet.git]
/
compiler
/
typecheck
/
TcForeign.lhs
diff --git
a/compiler/typecheck/TcForeign.lhs
b/compiler/typecheck/TcForeign.lhs
index
185e592
..
aa40d02
100644
(file)
--- 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 ()
\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)
check (isCLabelString str) (badCName str)
+ checkCConv cconv
checkForeignArgs isFFIExternalTy arg_tys
checkForeignRes nonIOok isFFIExportResultTy res_ty
where
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
#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}
#endif
checkCConv CmmCallConv = panic "checkCConv CmmCallConv"
\end{code}