X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcForeign.lhs;h=73fd449d32ce7e9bcb87fe255e238664e130af6b;hb=25bff7fe1a22edbafa188af8d844c67057fa5eb8;hp=330ce57f409823c3bc0acee4fc3275d1ce556728;hpb=a8dc46dcbeeaf94a5321a1b8932725f7650d7abd;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs index 330ce57..73fd449 100644 --- a/compiler/typecheck/TcForeign.lhs +++ b/compiler/typecheck/TcForeign.lhs @@ -132,7 +132,7 @@ tcCheckFIType sig_ty arg_tys res_ty idecl@(CImport cconv safety _ (CFunction tar return idecl | cconv == PrimCallConv = do dflags <- getDOpts - check (dopt Opt_GHCForeignImportPrim dflags) + check (xopt Opt_GHCForeignImportPrim dflags) (text "Use -XGHCForeignImportPrim to allow `foreign import prim'.") checkCg (checkCOrAsmOrLlvmOrDotNetOrInterp) checkCTarget target @@ -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" @@ -335,7 +336,7 @@ illegalForeignTyErr :: SDoc -> Type -> SDoc illegalForeignTyErr arg_or_res ty = hang (hsep [ptext (sLit "Unacceptable"), arg_or_res, ptext (sLit "type in foreign declaration:")]) - 4 (hsep [ppr ty]) + 2 (hsep [ppr ty]) -- Used for 'arg_or_res' argument to illegalForeignTyErr argument, result :: SDoc @@ -349,6 +350,6 @@ badCName target foreignDeclCtxt :: ForeignDecl Name -> SDoc foreignDeclCtxt fo = hang (ptext (sLit "When checking declaration:")) - 4 (ppr fo) + 2 (ppr fo) \end{code}