From b9b2cdaa4b88c91f6cd7ef7171a1598e1b3ce108 Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Thu, 4 Jul 2024 20:44:15 -0700 Subject: [PATCH] Remove utility.h and alignof workarounds GHCs older than 8.6 (`base` less than 4.12) are not supported anymore. --- System/Directory/Internal/C_utimensat.hsc | 4 +--- System/Directory/Internal/Windows.hsc | 4 +--- System/Directory/Internal/utility.h | 6 ------ 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 System/Directory/Internal/utility.h diff --git a/System/Directory/Internal/C_utimensat.hsc b/System/Directory/Internal/C_utimensat.hsc index 3d9b1942..cf2aeb34 100644 --- a/System/Directory/Internal/C_utimensat.hsc +++ b/System/Directory/Internal/C_utimensat.hsc @@ -12,7 +12,6 @@ module System.Directory.Internal.C_utimensat where #ifdef HAVE_SYS_STAT_H # include #endif -#include import Prelude () import System.Directory.Internal.Prelude import Data.Time.Clock.POSIX (POSIXTime) @@ -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 diff --git a/System/Directory/Internal/Windows.hsc b/System/Directory/Internal/Windows.hsc index 1c723fb4..6134bd81 100644 --- a/System/Directory/Internal/Windows.hsc +++ b/System/Directory/Internal/Windows.hsc @@ -12,7 +12,6 @@ module System.Directory.Internal.Windows where #include #include #include -#include #include import Prelude () import System.Directory.Internal.Prelude @@ -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 diff --git a/System/Directory/Internal/utility.h b/System/Directory/Internal/utility.h deleted file mode 100644 index 2f37ef34..00000000 --- a/System/Directory/Internal/utility.h +++ /dev/null @@ -1,6 +0,0 @@ -#if !defined(alignof) && __cplusplus < 201103L -# ifdef STDC_HEADERS -# include -# endif -# define alignof(x) offsetof(struct { char c; x m; }, m) -#endif