@@ -1,4 +1,4 @@
1−{-# LANGUAGE PatternGuards, ExistentialQuantification #-}
1+{-# LANGUAGE PatternGuards, ExistentialQuantification, CPP #-}
2module Core.Execute (execute) where
2module Core.Execute (execute) where
4import Idris.AbsSyntax
4import Idris.AbsSyntax
@@ -25,13 +25,19 @@ import Data.Maybe
25import Data.Bits
25import Data.Bits
26import qualified Data.Map as M
26import qualified Data.Map as M
28import Foreign.LibFFI
29import Foreign.LibFFI
29import Foreign.C.String
30import Foreign.C.String
30import Foreign.Marshal.Alloc (free)
31import Foreign.Marshal.Alloc (free)
31import Foreign.Ptr
32import Foreign.Ptr
33import System.IO
35import System.IO
38+execute :: Term -> Idris Term
39+execute tm = fail "libffi not supported, rebuild Idris with -f FFI"
35readMay :: (Read a) => String -> Maybe a
41readMay :: (Read a) => String -> Maybe a
36readMay s = case reads s of
42readMay s = case reads s of
37 [(x, "")] -> Just x
43 [(x, "")] -> Just x
@@ -529,3 +535,5 @@ findForeign fn = do est <- getExecState
529 show (length fs) ++ " occurrences."
535 show (length fs) ++ " occurrences."
530 return Nothing
536 return Nothing
531 where getFn lib = execIO $ catchIO (tryLoadFn fn lib) (\_ -> return Nothing)
537 where getFn lib = execIO $ catchIO (tryLoadFn fn lib) (\_ -> return Nothing)