1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
From 7d94bcd36eb1d5a2feae182fcb74f9d6ca439a80 Mon Sep 17 00:00:00 2001
From: Thomas Dziedzic <gostrc@gmail.com>
Date: Wed, 12 Sep 2012 03:29:46 -0700
Subject: [PATCH] fix for ghc 7.6.1 changes
---
c2hs/base/general/FileOps.hs | 3 ++-
c2hs/base/state/StateTrans.hs | 3 ++-
c2hs/toplevel/C2HSConfig.hs | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/c2hs/base/general/FileOps.hs b/c2hs/base/general/FileOps.hs
index 83ac70c..4914c4b 100644
--- a/c2hs/base/general/FileOps.hs
+++ b/c2hs/base/general/FileOps.hs
@@ -39,6 +39,7 @@ import Control.Monad (liftM)
import System.Random (newStdGen, randomRs)
import FNameOps (dirname, stripDirname, addPath)
+import System.IO.Error (catchIOError)
-- search for the given file in the given list of directories (EXPORTED)
@@ -89,7 +90,7 @@ mktemp pre post =
in do
h <- openFile fname ReadWriteMode
return (h, fname)
- `catch` \_ -> createLoop (attempts - 1) rs'
+ `catchIOError` \_ -> createLoop (attempts - 1) rs'
--
sixChars :: [Int] -> ([Int], String)
sixChars is =
diff --git a/c2hs/base/state/StateTrans.hs b/c2hs/base/state/StateTrans.hs
index ada62f4..2ab0ad1 100644
--- a/c2hs/base/state/StateTrans.hs
+++ b/c2hs/base/state/StateTrans.hs
@@ -84,6 +84,7 @@ import System.IO (fixIO)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Errors (interr)
+import System.IO.Error (catchIOError)
infixr 1 +>=, +>
@@ -337,7 +338,7 @@ fatalsHandledBy m handler =
ioError err
Right a -> return state
)
- `catch` (\err -> let
+ `catchIOError` (\err -> let
STB handler' = handler err
in
handler' bs gs)
diff --git a/c2hs/toplevel/C2HSConfig.hs b/c2hs/toplevel/C2HSConfig.hs
index e8deddf..af32886 100644
--- a/c2hs/toplevel/C2HSConfig.hs
+++ b/c2hs/toplevel/C2HSConfig.hs
@@ -46,7 +46,7 @@ import Data.Array (Array, array)
import Foreign (Ptr, FunPtr)
import Foreign (Storable(sizeOf, alignment), toBool)
-import Foreign.C (CInt)
+import Foreign.C (CInt(..))
import System.Info (os)
-- program settings
--
1.7.12
|