Skip to content
Browse files

Add CPP pragmas where necessary, and add MIN_VERSION_base conditional…

…s for non-linux platforms
  • Loading branch information...
1 parent 5f92500 commit 1773efbbfe8e16dbd1be968fa584bd1cd7a77194 @gregorycollins gregorycollins committed Aug 16, 2012
Showing with 14 additions and 2 deletions.
  1. +3 −2 src/System/FastLogger.hs
  2. +9 −0 src/System/SendFile/FreeBSD.hsc
  3. +2 −0 src/System/SendFile/Linux.hsc
View
5 src/System/FastLogger.hs
@@ -1,5 +1,6 @@
-{-# LANGUAGE BangPatterns #-}
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module System.FastLogger
View
9 src/System/SendFile/FreeBSD.hsc
@@ -1,15 +1,24 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
-- | FreeBSD system-dependent code for 'sendfile'.
module System.SendFile.FreeBSD (sendFile) where
import Control.Concurrent (threadWaitWrite)
import Data.Int
import Foreign.C.Error (eAGAIN, eINTR, getErrno, throwErrno)
+#if MIN_VERSION_base(4,5,0)
+import Foreign.C.Types (CSize(..), CInt(..))
+#else
import Foreign.C.Types (CInt, CSize)
+#endif
import Foreign.Marshal.Alloc (alloca)
import Foreign.Ptr (Ptr, nullPtr)
import Foreign.Storable (peek)
+#if MIN_VERSION_base(4,5,0)
+import System.Posix.Types (COff(..), Fd(..))
+#else
import System.Posix.Types (COff, Fd)
+#endif
sendFile :: IO () -> Fd -> Fd -> Int64 -> Int64 -> IO Int64
sendFile onBlock out_fd in_fd off count
View
2 src/System/SendFile/Linux.hsc
@@ -1,4 +1,6 @@
+{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
+
-- | Linux system-dependent code for 'sendfile'.
module System.SendFile.Linux (sendFile) where

0 comments on commit 1773efb

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