X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FConvert.lhs;h=ddc11adb135eae8e2e7a89229c36c9fbe4d93f22;hb=d9d7ceaa9f77c3d44a51405b71bb9fd4a44b6588;hp=a5f699472ce25d87a120e77fd3c0c92f46652911;hpb=3072ee8dfd68c5a89d4c756ba0dabbc84670a8e4;p=ghc-hetmet.git diff --git a/ghc/compiler/hsSyn/Convert.lhs b/ghc/compiler/hsSyn/Convert.lhs index a5f6994..ddc11ad 100644 --- a/ghc/compiler/hsSyn/Convert.lhs +++ b/ghc/compiler/hsSyn/Convert.lhs @@ -33,8 +33,10 @@ import TyCon ( DataConDetails(..) ) import Type ( Type ) import BasicTypes( Boxity(..), RecFlag(Recursive), NewOrData(..), StrictnessMark(..) ) -import ForeignCall ( Safety(..), CCallConv(..), CCallTarget(..) ) -import HsDecls ( CImportSpec(..), ForeignImport(..), ForeignDecl(..) ) +import ForeignCall ( Safety(..), CCallConv(..), CCallTarget(..), + CExportSpec(..)) +import HsDecls ( CImportSpec(..), ForeignImport(..), ForeignExport(..), + ForeignDecl(..) ) import FastString( FastString, mkFastString, nilFS ) import Char ( ord, isAscii, isAlphaNum, isAlpha ) import List ( partition ) @@ -120,6 +122,13 @@ cvt_top (ForeignD (ImportF callconv safety from nm typ)) Threadsafe -> PlaySafe True parsed = parse_ccall_impent nm from +cvt_top (ForeignD (ExportF callconv as nm typ)) + = let e = CExport (CExportStatic (mkFastString as) callconv') + in Left $ ForD (ForeignExport (vName nm) (cvtType typ) e False loc0) + where callconv' = case callconv of + CCall -> CCallConv + StdCall -> StdCallConv + parse_ccall_impent :: String -> String -> Maybe (FastString, CImportSpec) parse_ccall_impent nm s = case lex_ccall_impent s of