I have some #IF and #ENDIF in .hs. If I just rename the file to .chs, the #IF and #ENDIF are just moved to .h generated by c2hs instead of the .hs generated by c2hs.
I did not see this mentioned in https://github.com/haskell/c2hs/wiki/Implementation-of-Haskell-Binding-Modules .
Any idea how? Thanks.
I'm not positive this is the case since I've never had that problem before, but try lowercase preprocessor commands (
#if
,#endif
). Those are what I use, and c2hs processes them without any issue -- even without{-# LANGUAGE CPP #-}
!