Extension to the FFI to allow macro expansions to be avoided

Fergus Henderson fjh at cs.mu.oz.au
Wed Apr 14 14:32:01 EDT 2004


On 13-Apr-2004, Ross Paterson <ross at soi.city.ac.uk> wrote:
> And Hugs too.  The issue isn't extending the FFI but implementing it
> more accurately and consistently.  As you point out, systems compiling
> via C have been extending the FFI to a function+macro interface, which is
> incompatible with systems compiling to native code.  Having been bitten by
> the same thing in the opposite direction (macros that work with ffihugs
> or ghc -fvia-C don't work with ghc -fasm), I'd favour turning off the
> macro interface, preferably with #undef, at least by default.

I'd rather fix GHC so that interfacing with C macros works with ghc -fasm.
The equivalent works fine with the Mercury implementation ("mmc --target asm"
generates assembler for the Mercury code and C stubs for the FFI glue),
so it's clearly possible.

-- 
Fergus Henderson                    |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


More information about the FFI mailing list