RE: Extension to the FFI to allow macro expansions to be avoided
"Simon Marlow" <[email protected]> Fri, 16 Apr 2004 15:25:32 +0100
| Newsgroups | gmane.comp.lang.haskell.ffi |
|---|---|
| Message-ID | <3429668D0E777A499EE74A7952C382D101BF1BE4@EUR-MSG-01.europe.corp.microsoft.com> |
On 16 April 2004 11:33, Marcin 'Qrczak' Kowalczyk wrote: > Perhaps we should differentiate by a calling convention between > linking to a function directly and generating a source-level C call? > > The calling conventions we know would correspond to linking to them > directly. They would perform the necessary magic to turn off macros > when compiling via C, and they would not need a C compiler when > compiling via assembler. There is no need for specifying a C header > in this case. > > Another calling convention would generate a function wrapper with > proper argument types. It would need "foreign type" declarations and > included headers. The wrapped calling convention in this case is of > course irrelevant, so it's a calling convention rather than a > separate flag. I wondered about that (while writing my last post) but it still seems like a hefty price to pay for the small number of problematic cases we have, and given that you can already write the C stubs by hand to get the desired effect. Hmm, perhaps this falls in to the category of something we expect an external tool to do? Cheers, Simon