summaryrefslogtreecommitdiff
blob: df29d1ba08b866486166d755d533fa64269fd391 (plain)
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
--- wxdirect-0.90.1.1-orig/src/Classes.hs	2014-03-23 01:08:59.000000000 +1100
+++ wxdirect-0.90.1.1/src/Classes.hs	2014-03-23 15:43:57.402011540 +1100
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 -----------------------------------------------------------------------------------------
 {-| Module      :  Classes
     Copyright   :  (c) Daan Leijen 2003
@@ -24,6 +25,9 @@
 
 import qualified Data.Set as Set
 import qualified Data.Map as Map
+#if !MIN_VERSION_base(4,6,0)
+import Prelude hiding ( catch )
+#endif
 import Text.Parsec.Prim hiding ( try )
 import HaskellNames( haskellTypeName, isBuiltin )
 import Types
--- wxdirect-0.90.1.1-orig/src/CompileClasses.hs	2014-03-23 01:08:59.000000000 +1100
+++ wxdirect-0.90.1.1/src/CompileClasses.hs	2014-03-23 15:42:14.123894206 +1100
@@ -96,7 +96,7 @@
            (exportsStatic,exportsClassClasses,classCount) = exportDefs decls exportsClass []
 
            methodCount  = length decls
-           ghcoptions   = [ "{-# LANGUAGE ForeignFunctionInterface #-}"]
+           ghcoptions   = [ "{-# LANGUAGE CPP, ForeignFunctionInterface #-}"]
 
            export   = concat  [ ["module " ++ moduleRoot ++ moduleName
                                 , "    ( -- * Global" ]
@@ -111,6 +111,9 @@
                                 , "import Foreign.C.Types(CInt(..), CWchar(..), CChar(..), CDouble(..))"
                                 , "import " ++ moduleRoot ++ "WxcTypes"
                                 , "import " ++ moduleRoot ++ moduleClassTypesName
+                                , "#if (__GLASGOW_HASKELL__>=705)"
+                                , "import Foreign.C.Types(CDouble(..), CInt(..), CWchar(..))"
+                                , "#endif"
                                 , ""
                                 ]
                               ]