Skip to content

Commit 1ead969

Browse files
committed
TimeVal's members are 64 bit, per the unix package
1 parent bc6c51e commit 1ead969

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Graphics/X11/Xlib/Event.hsc

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import Data.Data
7171
#endif
7272

7373
#include "HsXlib.h"
74+
#include <sys/time.h>
7475

7576
{-# CFILES cbits/fdset.c #-}
7677

@@ -398,7 +399,7 @@ get_ConfigureEvent p = peekXConfigureEvent (castPtr p)
398399
-- Returns True if timeout occurs.
399400
waitForEvent :: Display -> Word32 -> IO Bool
400401
waitForEvent display usecs =
401-
with (TimeVal (usecs `div` 1000000) (usecs `mod` 1000000)) $ \ tv_ptr ->
402+
with (TimeVal (fromIntegral usecs `div` 1000000) (fromIntegral usecs `mod` 1000000)) $ \ tv_ptr ->
402403
allocaBytes #{size fd_set} $ \ readfds ->
403404
allocaBytes #{size fd_set} $ \ nofds -> do
404405
let fd = connectionNumber display
@@ -429,7 +430,7 @@ gettimeofday_in_milliseconds =
429430
TimeVal sec usec <- peek tv_ptr
430431
return (toInteger sec * 1000 + toInteger usec `div` 1000)
431432

432-
data TimeVal = TimeVal Word32 Word32
433+
data TimeVal = TimeVal CLong CLong
433434

434435
instance Storable TimeVal where
435436
alignment _ = #{size int}

X11.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: X11
2-
version: 1.10.3.9
2+
version: 1.10.3.10
33
synopsis: A binding to the X11 graphics library
44
description: A Haskell binding to the X11 graphics library. The binding is a direct
55
translation of the C binding; for documentation of these calls, refer

0 commit comments

Comments
 (0)