corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

Versions after 4.1.3 don't compile on DragonflyBSD #22

Closed cgag closed 9 years ago

cgag commented 9 years ago

I tried compiling with every verison after 4.1.3 and they all fail with the same errors:

Warning: Note that reinstalls are always dangerous. Continuing anyway...

System/Clock.hsc:82:39:
    Not in scope: type constructor or class `Word64'

System/Clock.hsc:83:39:
    Not in scope: type constructor or class `Word64'

System/Clock.hsc:94:26:
    Not in scope: type constructor or class `Word64'
cabal: Error: some packages failed to install:
amqp-0.12.2 depends on clock-0.4.2.0 which failed to install.
clock-0.4.2.0 failed during the building phase. The exception was:
ExitFailure 1

Problems with dragonfly are often problems on Freebsd as well but I'm not set up to test it.

CetinSert commented 9 years ago

what is your ghc version!?

cgag commented 9 years ago

Ah sorry, it's 7.8.3.

mboes commented 9 years ago

@cgag In current master there are no occurrences of Word64 anymore. Does the compilation still break?

cgag commented 9 years ago

I just tried it and get the same errors on 0.5.0.1. From what I can tell the common thing on all those lines is #{type clockid_t}, so I guess that's Word64? I don't really know anything about the FFI. I can't even find any reference to this #{type ...} syntax in the docs.

mboes commented 9 years ago

Aha. So the cause is that unlike other platforms, FreeBSD probably uses an unsigned long as the field type, which in Haskell is Word64, rather than Int64. So on FreeBSD, we need import Data.Word rather than Data.Int.

mboes commented 9 years ago

Sorry - unsigned long for the clockid_t typedef I meant.