mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
????
Merge branch 'master' of www.grammaticalframework.org:/usr/local/www/GF
This commit is contained in:
@@ -1,13 +1,7 @@
|
||||
-- | Isolate backwards incompatible library changes to 'catch' and 'try'
|
||||
{-# LANGUAGE CPP #-}
|
||||
-- | Backwards compatible 'catch' and 'try'
|
||||
module GF.System.Catch where
|
||||
import qualified System.IO.Error as S
|
||||
|
||||
-- ** Backwards compatible try and catch
|
||||
#if MIN_VERSION_base(4,4,0)
|
||||
catch = S.catchIOError
|
||||
try = S.tryIOError
|
||||
#else
|
||||
catch = S.catch
|
||||
try = S.try
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE CPP,ForeignFunctionInterface #-}
|
||||
{-# LANGUAGE ForeignFunctionInterface #-}
|
||||
-- | A variant of 'Control.Concurrent.setNumCapabilities' that automatically
|
||||
-- detects the number of processors in the system, and is available
|
||||
-- even when compiling with GHC<7.6.
|
||||
-- detects the number of processors in the system.
|
||||
module GF.System.Concurrency(
|
||||
-- * Controlling parallelism
|
||||
setNumCapabilities,getNumberOfProcessors) where
|
||||
@@ -16,13 +15,8 @@ import Foreign.C.Types(CInt(..))
|
||||
-- hasn't already been set with @+RTS -N/n/ -RTS@.
|
||||
setNumCapabilities opt_n =
|
||||
do n <- maybe getNumberOfProcessors return opt_n
|
||||
#if MIN_VERSION_base(4,6,0)
|
||||
C.setNumCapabilities n
|
||||
return True
|
||||
#else
|
||||
n_now <- C.getNumCapabilities
|
||||
return (n==n_now)
|
||||
#endif
|
||||
|
||||
-- | Returns the number of processors in the system.
|
||||
getNumberOfProcessors = fmap fromEnum c_getNumberOfProcessors
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
AC_INIT(Portable Grammar Format library, 0.1.pre,
|
||||
https://code.google.com/p/grammatical-framework/,
|
||||
AC_INIT(Portable Grammar Format library, 0.1-pre,
|
||||
http://www.grammaticalframework.org/,
|
||||
libpgf)
|
||||
AC_PREREQ(2.58)
|
||||
|
||||
|
||||
0
src/runtime/c/setup.sh
Normal file → Executable file
0
src/runtime/c/setup.sh
Normal file → Executable file
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE CPP, BangPatterns #-}
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
module PGF.Optimize
|
||||
( optimizePGF
|
||||
, updateProductionIndices
|
||||
@@ -11,11 +11,7 @@ import PGF.Macros
|
||||
import Data.List (mapAccumL)
|
||||
import Data.Array.IArray
|
||||
import Data.Array.MArray
|
||||
#if MIN_VERSION_base(4,6,0)
|
||||
import Data.Array.Unsafe as U(unsafeFreeze)
|
||||
#else
|
||||
import Data.Array.ST as U(unsafeFreeze)
|
||||
#endif
|
||||
import Data.Array.ST
|
||||
import Data.Array.Unboxed
|
||||
import qualified Data.Map as Map
|
||||
|
||||
Reference in New Issue
Block a user