Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cc2a84025a674d53e83e348f20e0922234706d7c

>---------------------------------------------------------------

commit cc2a84025a674d53e83e348f20e0922234706d7c
Author: Ian Lynagh <[email protected]>
Date:   Fri Oct 14 20:36:30 2011 +0100

    Remove some CPP

>---------------------------------------------------------------

 compiler/typecheck/TcForeign.lhs |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/compiler/typecheck/TcForeign.lhs b/compiler/typecheck/TcForeign.lhs
index 0f713f3..c324eca 100644
--- a/compiler/typecheck/TcForeign.lhs
+++ b/compiler/typecheck/TcForeign.lhs
@@ -43,10 +43,13 @@ import Coercion
 import PrelNames
 import DynFlags
 import Outputable
+import Platform
 import SrcLoc
 import Bag
 import FastString
 import Util
+
+import Control.Monad
 \end{code}
 
 \begin{code}
@@ -404,12 +407,11 @@ Calling conventions
 \begin{code}
 checkCConv :: CCallConv -> TcM ()
 checkCConv CCallConv    = return ()
-#if i386_TARGET_ARCH
-checkCConv StdCallConv  = return ()
-#else
--- 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 StdCallConv  = do dflags <- getDOpts
+                             let platform = targetPlatform dflags
+                             unless (platformArch platform == ArchX86) $
+                                 -- This is a warning, not an error. see #3336
+                                 addWarnTc (text "the 'stdcall' calling 
convention is unsupported on this platform," $$ text "treating as ccall")
 checkCConv PrimCallConv = addErrTc (text "The `prim' calling convention can 
only be used with `foreign import'")
 checkCConv CmmCallConv  = panic "checkCConv CmmCallConv"
 \end{code}



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to