Changeset 16498
- Timestamp:
- 05/22/07 12:40:04 (18 months ago)
- Location:
- src/Pugs
- Files:
-
- 2 modified
-
Compat.hs (modified) (3 diffs)
-
Embed/Parrot.hsc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Compat.hs
r15464 r16498 16 16 17 17 module Pugs.Compat ( 18 _PUGS_HAVE_POSIX, 18 19 createLink, 19 20 createSymbolicLink, … … 72 73 import qualified System.Posix.Signals 73 74 75 _PUGS_HAVE_POSIX :: Bool 76 _PUGS_HAVE_POSIX = True 77 74 78 doesExist :: FilePath -> IO Bool 75 79 doesExist = fileExist … … 142 146 import System.Posix.Internals 143 147 import Foreign.C.Error 148 149 _PUGS_HAVE_POSIX :: Bool 150 _PUGS_HAVE_POSIX = False 144 151 145 152 failWith :: (Monad m) => String -> m a -
src/Pugs/Embed/Parrot.hsc
r13724 r16498 1 1 {-# OPTIONS_GHC -fglasgow-exts -cpp -fvia-C -fno-full-laziness -fno-cse #-} 2 2 #if !defined(PUGS_HAVE_PARROT) 3 ##undef PUGS_HAVE_POSIX4 ##include "../pugs_config.h"5 3 6 4 module Pugs.Embed.Parrot where … … 13 11 import Data.Maybe 14 12 import Control.Monad 15 import Pugs.Compat (getEnv )13 import Pugs.Compat (getEnv, _PUGS_HAVE_POSIX) 16 14 import Pugs.Internals (encodeUTF8) 17 15 … … 34 32 findExecutableInDirectory :: FilePath -> FilePath -> IO (Maybe FilePath) 35 33 findExecutableInDirectory dir cmd = do 36 ##ifdef PUGS_HAVE_POSIX 37 let file = dir ++ ('/':cmd) 38 ##else 39 let file = dir ++ ('\\':cmd) ++ ".exe" 40 ##endif 41 ok <- doesFileExist file 42 return $ if ok then Just file else Nothing 34 let file | _PUGS_HAVE_POSIX = dir ++ ('/':cmd) 35 | otherwise = dir ++ ('\\':cmd) ++ ".exe" 36 ok <- doesFileExist file 37 return $ if ok then (Just file) else Nothing 43 38 44 39 findParrot :: IO FilePath
