5 Sep
2009
5 Sep
'09
5:21 a.m.
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/