[jhc] darcs patch: fix System.CPUTime.

John Meacham john at repetae.net
Fri Sep 4 19:51:26 EDT 2009


Well, the important thing is that it uses the same calling convention,
since we are converting to Integer and not doing any math with the
CClock type. Jhc has the useful property that 'calling convention' and
the size of the haskell type are decoupled. so something like this will
work and be portable.

newtype CClock = CClock Integer

then add an entry in DataConstructors.typeTable with

(tc_CClock, "clock_t")

now, when you can use CClock in ffi declarations and it will properly
pass it as clock_t.

Ideally, I would like to introduce a pragma to declare these. like

{-# CTYPE CClock clock_t #-}


        John
-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the jhc mailing list