Commit 8e0adc02 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Check we're not using stdcall in foreign export on unsupported platforms

It's already checked for foreign import, but was missing for export.
parent a0f52966
...@@ -243,8 +243,9 @@ tcFExport d = pprPanic "tcFExport" (ppr d) ...@@ -243,8 +243,9 @@ tcFExport d = pprPanic "tcFExport" (ppr d)
\begin{code} \begin{code}
tcCheckFEType :: Type -> ForeignExport -> TcM () 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 checkForeignArgs isFFIExternalTy arg_tys
checkForeignRes nonIOok isFFIExportResultTy res_ty checkForeignRes nonIOok isFFIExportResultTy res_ty
where where
...@@ -341,7 +342,7 @@ checkCConv CCallConv = return () ...@@ -341,7 +342,7 @@ checkCConv CCallConv = return ()
#if i386_TARGET_ARCH #if i386_TARGET_ARCH
checkCConv StdCallConv = return () checkCConv StdCallConv = return ()
#else #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 #endif
checkCConv CmmCallConv = panic "checkCConv CmmCallConv" checkCConv CmmCallConv = panic "checkCConv CmmCallConv"
\end{code} \end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment