diff --git a/examples/plugs/runplugs/Main.hs b/examples/plugs/runplugs/Main.hs index 11f878b..538fdfe 100644 --- a/examples/plugs/runplugs/Main.hs +++ b/examples/plugs/runplugs/Main.hs @@ -15,12 +15,14 @@ import Control.Monad (when) import System.Exit (exitWith, ExitCode(ExitSuccess)) import System.IO (getContents, putStrLn) +#if !defined(CYGWIN) && !defined(__MINGW32__) import System.Posix.Resource (setResourceLimit, Resource(ResourceCPUTime), ResourceLimits(ResourceLimits), ResourceLimit(ResourceLimit)) rlimit = ResourceLimit 3 +#endif context = prehier ++ datas ++ controls @@ -40,7 +42,9 @@ datas = map ("Data." ++) [ controls = map ("Control." ++) ["Monad", "Arrow"] main = do +#if !defined(CYGWIN) && defined(__MINGW32__) setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit) +#endif s <- getContents when (not . null $ s) $ do s <- unsafeEval ("(take 2048 (show ("++s++")))") context diff --git a/examples/plugs/runplugs/Makefile b/examples/plugs/runplugs/Makefile index 3d4b7e0..b95e54d 100644 --- a/examples/plugs/runplugs/Makefile +++ b/examples/plugs/runplugs/Makefile @@ -1,6 +1,6 @@ -GHCFLAGS= -O +GHCFLAGS= -O $(GHC_EXTRA_OPTS) PKGFLAGS= -package-conf $(TOP)/plugins.conf.inplace -PKGFLAGS+= -package plugins -package unix +PKGFLAGS+= -package plugins all: build diff --git a/src/plugins/System/Plugins/Utils.hs b/src/plugins/System/Plugins/Utils.hs index bf31ace..fccf48d 100644 --- a/src/plugins/System/Plugins/Utils.hs +++ b/src/plugins/System/Plugins/Utils.hs @@ -283,7 +283,7 @@ dropSuffix f = reverse . tail . dropWhile (/= '.') $ reverse f -- -- | work out the mod name from a filepath mkModid :: String -> String -mkModid = (takeWhile (/= '.')) . reverse . (takeWhile (/= '/')) . reverse +mkModid = (takeWhile (/= '.')) . reverse . (takeWhile (\x -> ('/'/= x) && ('\\' /= x))) . reverse -----------------------------------------------------------