Skip to content

Commit

Permalink
fixing strict
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed May 30, 2023
1 parent c3fbba7 commit 9d29533
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Network/Socket/Options.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -488,16 +488,16 @@ newtype SocketTimeout = SocketTimeout Word32 deriving (Eq, Ord, Show)

#if defined(mingw32_HOST_OS)
instance Storable SocketTimeout where
sizeOf (SocketTimeout to) = sizeOf to -- DWORD as milliseconds
alignment _ = 0
sizeOf ~(SocketTimeout to) = sizeOf to -- DWORD as milliseconds
alignment ~_ = 0
peek ptr = do
to <- peek (castPtr ptr)
return $ SocketTimeout (to * 1000)
poke ptr (SocketTimeout to) = poke (castPtr ptr) (to `div` 1000)
#else
instance Storable SocketTimeout where
sizeOf _ = (#size struct timeval)
alignment _ = (#const offsetof(struct {char x__; struct timeval (y__); }, y__))
sizeOf ~_ = (#size struct timeval)
alignment ~_ = (#const offsetof(struct {char x__; struct timeval (y__); }, y__))
peek ptr = do
sec <- (#peek struct timeval, tv_sec) ptr
usec <- (#peek struct timeval, tv_usec) ptr
Expand Down

0 comments on commit 9d29533

Please sign in to comment.