Skip to content

Commit

Permalink
Add CPP pragmas where necessary, and add MIN_VERSION_base conditional…
Browse files Browse the repository at this point in the history
…s for non-linux platforms
  • Loading branch information
gregorycollins committed Aug 16, 2012
1 parent 5f92500 commit 1773efb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/System/FastLogger.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}

module System.FastLogger
Expand Down
9 changes: 9 additions & 0 deletions src/System/SendFile/FreeBSD.hsc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/System/SendFile/Linux.hsc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}

-- | Linux system-dependent code for 'sendfile'.
module System.SendFile.Linux (sendFile) where

Expand Down

0 comments on commit 1773efb

Please sign in to comment.