On Sunday 02 January 2011 13:45:13, Robert Clausecker wrote:
>
> I guess the easiest way would be to use CPP, but is there any flag for
> the wordsize?

Not directly, but I think

{-# LANGUAGE CPP #-}

#include "MachDeps.h"

#if WORD_SIZE_IN_BITS == 32

type MyGen = MyGen32

#else    // GHC only works with 32- and 64-bit words

type MyGen = MyGen64

#endif

should do it.

MachDeps.h ties you to GHC of course, if you want it to work on other 
compilers too, I guess you need a configure script.



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to