Support FreeBSD in streamly-core

This commit is contained in:
Adithya Kumar 2024-04-30 16:48:00 +05:30
parent 755c99de1a
commit e4ce30bd63
3 changed files with 5 additions and 3 deletions

View File

@ -91,7 +91,7 @@ import Streamly.Data.Stream (Stream)
import Streamly.Internal.Data.Unfold (Step(..))
import Streamly.Internal.Data.Unfold.Type (Unfold(..))
import System.FilePath ((</>))
#if (defined linux_HOST_OS) || (defined darwin_HOST_OS)
#if (defined linux_HOST_OS) || (defined darwin_HOST_OS) || (defined freebsd_HOST_OS)
import System.Posix (DirStream, openDirStream, readDirStream, closeDirStream)
#elif defined(mingw32_HOST_OS)
import qualified System.Win32 as Win32
@ -239,7 +239,7 @@ toStreamWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
-- XXX exception handling
#if (defined linux_HOST_OS) || (defined darwin_HOST_OS)
#if (defined linux_HOST_OS) || (defined darwin_HOST_OS) || (defined freebsd_HOST_OS)
{-# INLINE streamReader #-}
streamReader :: MonadIO m => Unfold m DirStream FilePath
streamReader = Unfold step return

View File

@ -545,7 +545,7 @@ library
if !flag(use-unliftio)
build-depends: monad-control >= 1.0 && < 1.1
if os(linux) || os (darwin)
if os(linux) || os (darwin) || os(freebsd)
build-depends: unix >= 2.7.0 && < 2.9
if os(windows)

View File

@ -386,6 +386,8 @@ test-suite FileSystem.Event
ghc-options: -main-is Streamly.Test.FileSystem.Event
main-is: Streamly/Test/FileSystem/Event.hs
other-modules: Streamly.Test.FileSystem.Event.Common
if !(os(linux) || os(darwin) || os(windows))
buildable: False
if flag(use-streamly-core)
buildable: False