Bryan O'Sullivan avatar Bryan O'Sullivan committed 342311f

Make GHC 7.4.1 happier

Comments (0)

Files changed (2)

Data/BloomFilter/Array.hs

-{-# LANGUAGE FlexibleContexts, ForeignFunctionInterface, MagicHash,
+{-# LANGUAGE CPP, FlexibleContexts, ForeignFunctionInterface, MagicHash,
              Rank2Types, UnliftedFFITypes #-}
 
 module Data.BloomFilter.Array (newArray) where
 
 import Control.Monad.ST (ST, unsafeIOToST)
 import Data.Array.Base (MArray, STUArray(..), unsafeNewArray_)
+#if __GLASGOW_HASKELL__ >= 704
+import Foreign.C.Types (CInt(..), CSize(..))
+#else
 import Foreign.C.Types (CInt, CSize)
+#endif
 import Foreign.Ptr (Ptr)
 import GHC.Base (MutableByteArray#)
 

tests/QCSupport.hs

-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving #-}
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 
 module QCSupport
 instance Arbitrary Ordering where
     arbitrary = oneof [return LT, return GT, return EQ]
 
+-- For some reason, MIN_VERSION_random doesn't work here :-(
+#if __GLASGOW_HASKELL__ < 704
 integralRandomR :: (Integral a, RandomGen g) => (a, a) -> g -> (a, g)
 integralRandomR (a,b) g = case randomR (fromIntegral a :: Int,
                                         fromIntegral b :: Int) g
 instance Random Int64 where
   randomR = integralRandomR
   random = randomR (minBound,maxBound)
+#endif
 
 instance Arbitrary LB.ByteString where
     arbitrary = sized $ \n -> resize (round (sqrt (toEnum n :: Double)))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.