24 Apr 2006 13:22
24 Apr 2006 17:29
26 Apr 2006 14:26
cvs commit: hugs98/src runhugs.c
Ross Paterson <ross <at> soi.city.ac.uk>
2006-04-26 12:26:44 GMT
2006-04-26 12:26:44 GMT
ross 2006/04/26 05:26:44 PDT
Modified files:
src runhugs.c
Log:
Dummy implementation of updateTimers() for runhugs to get --enable-timers
working (fixes #19).
Revision Changes Path
1.23 +8 -2 hugs98/src/runhugs.c
26 Apr 2006 15:43
26 Apr 2006 15:54
Re: Compiling ffihugs
Ross Paterson <ross <at> soi.city.ac.uk>
2006-04-26 13:54:43 GMT
2006-04-26 13:54:43 GMT
On Wed, Apr 26, 2006 at 02:43:23PM +0100, Neil Mitchell wrote: > Where is the main procedure for ffihugs? I'm not sure really where it > is, or how to go about building it. Just a general pointer to the > main, and I should be able to chase the dependancies from there. It's runhugs.c compiled with -DFFI_COMPILER (sorry: it wasn't me).
26 Apr 2006 16:15
cvs commit: hugs98/src/msc hugs.sln ffihugs.vcproj
Neil Mitchell <ndmitchell <at> gmail.com>
2006-04-26 14:15:47 GMT
2006-04-26 14:15:47 GMT
neil 2006/04/26 07:15:47 PDT
Modified files:
src/msc hugs.sln
Added files:
src/msc ffihugs.vcproj
Log:
Add an ffihugs project for visual studio
Revision Changes Path
1.2 +8 -0 hugs98/src/msc/hugs.sln
26 Apr 2006 18:29
Using hugsffi
Neil Mitchell <ndmitchell <at> gmail.com>
2006-04-26 16:29:57 GMT
2006-04-26 16:29:57 GMT
Hi,
I now can build ffihugs, and have added some patches so it finds
visual studio etc. I'm currently have ffihugs do something
"unexpected" - but I'm not sure what the real behaviour is...
-- test.hs
import Foreign
import System.Environment
main = print $ c_test 1 2
foreign import ccall unsafe "test.h test" c_test :: Int -> Int -> Int
-- test.c
int test(int a, int b){return 42;}
-- test.h
int test(int a, int b);
Then I run (as per http://cvs.haskell.org/Hugs/pages/users_guide/ffihugs.html):
ffihugs test.hs test.c
And before compiling hugs has clobbered test.c, and removed my code
from it. This gives a link error, since test is undefined.
Is this how ffihugs is supposed to work? Should my code be going somewhere else?
Thanks
(Continue reading)
26 Apr 2006 18:35
Re: Using hugsffi
Ross Paterson <ross <at> soi.city.ac.uk>
2006-04-26 16:35:01 GMT
2006-04-26 16:35:01 GMT
On Wed, Apr 26, 2006 at 05:29:57PM +0100, Neil Mitchell wrote: > ffihugs test.hs test.c > > And before compiling hugs has clobbered test.c, and removed my code > from it. This gives a link error, since test is undefined. > > Is this how ffihugs is supposed to work? Should my code be going somewhere else? It generates Foo.c from Foo.hs, so yes, you need to call your C file something else. I'll update the docs, as the example given there fails on a case-insensitive filesystem.
26 Apr 2006 18:53
cvs commit: hugs98/docs/users_guide others.xml
Ross Paterson <ross <at> soi.city.ac.uk>
2006-04-26 16:53:29 GMT
2006-04-26 16:53:29 GMT
ross 2006/04/26 09:53:29 PDT
Modified files:
docs/users_guide others.xml
Log:
fix the ffihugs example for Windows
(presumably the -lm is wrong too?)
Revision Changes Path
1.3 +19 -10 hugs98/docs/users_guide/others.xml
26 Apr 2006 19:55
Windows FFI patch
Neil Mitchell <ndmitchell <at> gmail.com>
2006-04-26 17:55:58 GMT
2006-04-26 17:55:58 GMT
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(Continue reading)
RSS Feed