Windows FFI patch

Ross Paterson ross at soi.city.ac.uk
Wed Apr 26 14:26:19 EDT 2006


On Wed, Apr 26, 2006 at 06:55:58PM +0100, Neil Mitchell wrote:
> 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?

I'm afraid it does: the arguments are usually C files and -l options
for libraries, and the libraries are scanned in the order they appear.
Put them too early, and it fails to find a symbol defined in a later
file.  Perhaps we should make it vary.

> 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.

Great.

> 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.

Sorry about that.  I've already added such a warning.



More information about the Cvs-hugs mailing list