Skip to content
Browse files

GHC 7.4 compatibility.

  • Loading branch information...
1 parent 94c71e4 commit 16e0668a7b2c9a9bef98cbcf4414ff26780c57f9 @bos committed
Showing with 6 additions and 2 deletions.
  1. +1 −1 Database/MySQL/Base.hs
  2. +5 −1 Database/MySQL/Base/C.hsc
View
2 Database/MySQL/Base.hs
@@ -554,7 +554,7 @@ withMaybeString :: Maybe String -> (CString -> IO a) -> IO a
withMaybeString Nothing act = act nullPtr
withMaybeString (Just xs) act = withCString xs act
-check :: Num a => String -> Connection -> a -> IO ()
+check :: (Eq a, Num a) => String -> Connection -> a -> IO ()
check func conn r = unless (r == 0) $ connectionError func conn
{-# INLINE check #-}
View
6 Database/MySQL/Base/C.hsc
@@ -1,4 +1,4 @@
-{-# LANGUAGE EmptyDataDecls, ForeignFunctionInterface #-}
+{-# LANGUAGE CPP, EmptyDataDecls, ForeignFunctionInterface #-}
-- |
-- Module: Database.MySQL.Base.C
@@ -71,7 +71,11 @@ module Database.MySQL.Base.C
import Data.ByteString.Unsafe (unsafeUseAsCString)
import Database.MySQL.Base.Types
import Foreign.C.String (CString, withCString)
+##if __GLASGOW_HASKELL__ >= 704
+import Foreign.C.Types (CChar(..), CInt(..), CUInt(..), CULLong(..), CULong(..))
+##else
import Foreign.C.Types (CInt, CUInt, CULLong, CULong)
+##endif
import Foreign.Marshal.Utils (with)
import Foreign.Ptr (Ptr, nullPtr)

0 comments on commit 16e0668

Please sign in to comment.
Something went wrong with that request. Please try again.