Windows FFI patch

Neil Mitchell ndmitchell at gmail.com
Wed Apr 26 13:55:58 EDT 2006


Hi,

Attached is a patch that is useful (but not essential) for Windows FFI
to work slightly better.

Hugs builds up a command line that it passes to the compiler, for example:

gcc -blah1 <filename> -blah2

In certain compilers -blah2 would not apply to <filename>, as a result
when compiling with MSVC, the use of blah2 after <filename> generates
a warning, but still works. The simple solution is the attached patch
which moves -blah2 before <filename>.

Does this harm gcc? If not then its probably a useful patch. If yes,
then I'll get over it.

There are a few other patches required for FFI - since the command
line used by Hugs in the tree hasn't worked with visual studio
compilers for a long time - I'll commit some patches tonight.

With these tweaks, ffihugs works just great with windows. The only
thing potentially missing is a warning that your carefully written C
file is about to be trashed by ffihugs if you do the "obvious" thing.
Or perhaps hugs should use a different name for the file generates,
like test.temp.hugs.c ? Just anything thats less likely to clash.

Thanks

Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: windows_ffi.patch
Type: application/octet-stream
Size: 763 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/cvs-hugs/attachments/20060426/9ffb5f07/windows_ffi.obj


More information about the Cvs-hugs mailing list