Re: Extension to the FFI to allow macro expansions to be avoided

Alastair Reid <[email protected]> Tue, 13 Apr 2004 11:53:22 +0100
Newsgroups gmane.comp.lang.haskell.ffi
Organization Reid Consulting (UK) Ltd
Message-ID <[email protected]>
> 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.

Maybe the code generated by Hugs should be something like:

#ifdef MACROS_ARE_COOL
#undef malloc
#endif

?

(I'm not likely to implement this anytime soon but if someone has the energy 
to do so, go right ahead.)

From what I know of NHC, it probably has the same extension and would benefit 
from the same cleanup.

--
Alastair