Skip to content

Commit

Permalink
Remove utility.h and alignof workarounds
Browse files Browse the repository at this point in the history
GHCs older than 8.6 (`base` less than 4.12) are not supported anymore.
  • Loading branch information
Rufflewind committed Jul 5, 2024
1 parent 73cea1f commit b9b2cda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
4 changes: 1 addition & 3 deletions System/Directory/Internal/C_utimensat.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module System.Directory.Internal.C_utimensat where
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <System/Directory/Internal/utility.h>
import Prelude ()
import System.Directory.Internal.Prelude
import Data.Time.Clock.POSIX (POSIXTime)
Expand All @@ -21,8 +20,7 @@ data CTimeSpec = CTimeSpec EpochTime CLong

instance Storable CTimeSpec where
sizeOf _ = #{size struct timespec}
-- workaround (hsc2hs for GHC < 8.0 doesn't support #{alignment ...})
alignment _ = #{size char[alignof(struct timespec)] }
alignment _ = #{alignment struct timespec}
poke p (CTimeSpec sec nsec) = do
(#poke struct timespec, tv_sec) p sec
(#poke struct timespec, tv_nsec) p nsec
Expand Down
4 changes: 1 addition & 3 deletions System/Directory/Internal/Windows.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module System.Directory.Internal.Windows where
#include <shlobj.h>
#include <windows.h>
#include <HsBaseConfig.h>
#include <System/Directory/Internal/utility.h>
#include <System/Directory/Internal/windows_ext.h>
import Prelude ()
import System.Directory.Internal.Prelude
Expand Down Expand Up @@ -177,8 +176,7 @@ win32_alloca_REPARSE_DATA_BUFFER action =
allocaBytesAligned size align $ \ ptr ->
action (ptr, size)
where size = fromIntegral win32_mAXIMUM_REPARSE_DATA_BUFFER_SIZE
-- workaround (hsc2hs for GHC < 8.0 don't support #{alignment ...})
align = #{size char[alignof(HsDirectory_REPARSE_DATA_BUFFER)]}
align = #{alignment HsDirectory_REPARSE_DATA_BUFFER}

win32_peek_REPARSE_DATA_BUFFER
:: Ptr Win32_REPARSE_DATA_BUFFER -> IO Win32_REPARSE_DATA_BUFFER
Expand Down
6 changes: 0 additions & 6 deletions System/Directory/Internal/utility.h

This file was deleted.

0 comments on commit b9b2cda

Please sign in to comment.