summaryrefslogtreecommitdiff
path: root/src/compiler/GF
diff options
context:
space:
mode:
authorInari Listenmaa <inari.listenmaa@gmail.com>2017-08-21 10:26:57 +0300
committerInari Listenmaa <inari.listenmaa@gmail.com>2017-08-21 10:26:57 +0300
commitc89759e6388aa00a82c9a4847be73c9e71726147 (patch)
tree5994c67ad1d79820d18451518265de5c91c60b30 /src/compiler/GF
parent2d85550e5466c18f248321f7eab333025098ea53 (diff)
parent0a3b822313cc664cef860b39ec74c21e0d00475b (diff)
Merge branch 'master' of https://github.com/GrammaticalFramework/GF
Diffstat (limited to 'src/compiler/GF')
-rw-r--r--src/compiler/GF/System/Catch.hs8
-rw-r--r--src/compiler/GF/System/Concurrency.hs10
2 files changed, 3 insertions, 15 deletions
diff --git a/src/compiler/GF/System/Catch.hs b/src/compiler/GF/System/Catch.hs
index f69934af5..11fae1a7b 100644
--- a/src/compiler/GF/System/Catch.hs
+++ b/src/compiler/GF/System/Catch.hs
@@ -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
diff --git a/src/compiler/GF/System/Concurrency.hs b/src/compiler/GF/System/Concurrency.hs
index 41f318c7a..514eab649 100644
--- a/src/compiler/GF/System/Concurrency.hs
+++ b/src/compiler/GF/System/Concurrency.hs
@@ -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