@@ -1,4 +1,4 @@
1−{-# LANGUAGE PatternGuards, ExistentialQuantification #-}
1+{-# LANGUAGE PatternGuards, ExistentialQuantification, CPP #-}
22module Core.Execute (execute) where
33
44import Idris.AbsSyntax
@@ -25,13 +25,19 @@ import Data.Maybe
2525import Data.Bits
2626import qualified Data.Map as M
2727
28+#ifdef IDRIS_FFI
2829import Foreign.LibFFI
2930import Foreign.C.String
3031import Foreign.Marshal.Alloc (free)
3132import Foreign.Ptr
33+#endif
3234
3335import System.IO
3436
37+#ifndef IDRIS_FFI
38+execute :: Term -> Idris Term
39+execute tm = fail "libffi not supported, rebuild Idris with -f FFI"
40+#else -- rest of file
3541readMay :: (Read a) => String -> Maybe a
3642readMay s = case reads s of
3743 [(x, "")] -> Just x
@@ -529,3 +535,5 @@ findForeign fn = do est <- getExecState
529535 show (length fs) ++ " occurrences."
530536 return Nothing
531537 where getFn lib = execIO $ catchIO (tryLoadFn fn lib) (\_ -> return Nothing)
538+
539+#endif