Zbigniew scripsit:
> Did you change the return type of your function back to 'float'?
No, I apparently just failed to recompile. Here's what I've got now:
$ cat callit.scm
#>
double baz(int i);
<#
(define baz (foreign-lambda float "baz" int))
(print baz)
(print (baz 42))
[EMAIL PROTECTED] /tmp
$ cat impl.c
#include <math.h>
double baz(int i)
{
return (((double)i) / 15.2);
}
[EMAIL PROTECTED] /tmp
$ csc callit.scm impl.c
Info: resolving _C_temporary_stack by linking to __imp__C_temporary_stack
(auto-import)
Info: resolving _C_stack_limit by linking to __imp__C_stack_limit (auto-import)
Info: resolving _C_fromspace_top by linking to __imp__C_fromspace_top
(auto-import)
Info: resolving _C_fromspace_limit by linking to __imp__C_fromspace_limit
(auto-import)
Info: resolving _C_timer_interrupt_counter by linking to
__imp__C_timer_interrupt_counter (auto-import)
[EMAIL PROTECTED] /tmp
$ ./callit
#<procedure (baz a03)>
2.76315789473684
So it works.
--
John Cowan [EMAIL PROTECTED] http://ccil.org/~cowan
Female celebrity stalker, on a hot morning in Cairo:
"Imagine, Colonel Lawrence, ninety-two already!"
El Auruns's reply: "Many happy returns of the day!"
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users