|
From: | Zbigniew |
Subject: | Re: [Chicken-users] return a float from foreign function |
Date: | Mon, 28 Aug 2006 14:50:43 -0500 |
Good. The reason this happens is that floats and ints (and other types like doubles and structs) are not necessarily returned or passed interchangably. Omitting the prototype causes your code to expect the default integer return type from your foreign function, which produces unspecified behaviour that varies from platform to platform. libffi exists in great part to handle hairy calling conventions. I found this out the hard way while writing the Objective C interface. On 8/28/06, John Cowan <address@hidden> wrote:
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: [...] So it works.
[Prev in Thread] | Current Thread | [Next in Thread] |