on master help sign in
Use WORD_SIZE_IN_BITS for Word32 guard
f8380ceJulian Ospald
src/Streamly/Internal/Data/Time/TimeSpec.hsc+3−1
@@ -9,6 +9,8 @@
9
9
10#include "Streamly/Internal/Data/Time/Clock/config-clock.h"
10#include "Streamly/Internal/Data/Time/Clock/config-clock.h"
11
11
12+#include "MachDeps.h"
13+
12-- |
14-- |
13-- Module : Streamly.Internal.Data.Time.TimeSpec
15-- Module : Streamly.Internal.Data.Time.TimeSpec
14-- Copyright : (c) 2019 Composewell Technologies
16-- Copyright : (c) 2019 Composewell Technologies
@@ -24,7 +26,7 @@ module Streamly.Internal.Data.Time.TimeSpec
24where
26where
25
27
26import Data.Int (Int64)
28import Data.Int (Int64)
27−#if i386_HOST_ARCH
29+#if (WORD_SIZE_IN_BITS == 32)
28import Data.Int (Int32)
30import Data.Int (Int32)
29#endif
31#endif
30import Foreign.Storable (Storable(..), peek)
32import Foreign.Storable (Storable(..), peek)
src/Streamly/Internal/FileSystem/IOVec.hsc+5−2
@@ -1,3 +1,5 @@
1+#include "MachDeps.h"
2+
1-- |
3-- |
2-- Module : Streamly.Internal.FileSystem.IOVec
4-- Module : Streamly.Internal.FileSystem.IOVec
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
@@ -17,8 +19,9 @@ module Streamly.Internal.FileSystem.IOVec
17 )
19 )
18where
20where
19
21
22+
20import Data.Word (Word8)
23import Data.Word (Word8)
21−#if defined(i386_HOST_ARCH)
24+#if (WORD_SIZE_IN_BITS == 32)
22import Data.Word (Word32)
25import Data.Word (Word32)
23#else
26#else
24import Data.Word (Word64)
27import Data.Word (Word64)
@@ -36,7 +39,7 @@ import Foreign.Storable (Storable(..))
36
39
37data IOVec = IOVec
40data IOVec = IOVec
38 { iovBase :: {-# UNPACK #-} !(Ptr Word8)
41 { iovBase :: {-# UNPACK #-} !(Ptr Word8)
39−#if defined(i386_HOST_ARCH)
42+#if (WORD_SIZE_IN_BITS == 32)
40 , iovLen :: {-# UNPACK #-} !Word32
43 , iovLen :: {-# UNPACK #-} !Word32
41#else
44#else
42 , iovLen :: {-# UNPACK #-} !Word64
45 , iovLen :: {-# UNPACK #-} !Word64