problems with FFI including h files

Wolfgang Thaller wolfgang.thaller@gmx.net
Mon, 03 Jun 2002 13:38:38 +0100


On 2002-06-03 12:46:19 +0100 Simon Marlow <simonmar@microsoft.com> wrote:

>> We really *should* do this, I know.  The problem is that it isn't free
> by a long shot: it'll make .hc files significantly larger, and obfuscate
> a lot of code.
> Anyone have any ideas that don't have such a big impact?

Well, what about including FFI headers _before_ the RTS headers? This should solve the problem here (parameter names taken by RTS). The problem would of course persist if someone wants to foreign import an entity called R1 or something like that.
The only disadvantage I can think of is that FFI-included headers that rely on RTS definitions would have to be changed to manually include the RTS headers they depend upon - not a common case, IMHO.

By the way, I just noticed that using {-# OPTIONS -#include "..." #-} with GHC 5.03 causes the include file to be included _twice_. It's only included once if I specify it on the command line. No double-including in any case with 5.02.


Regards,

Wolfgang