chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Type conversion in the FFI


From: Felix Winkelmann
Subject: Re: [Chicken-users] Type conversion in the FFI
Date: Wed, 14 Apr 2004 09:00:06 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

Daniel B. Faken wrote:

I was basically trying to avoid the double-definition of functions (as of 'foo' above) in scheme, just using the chicken-parsed C interface, but
I guess the FFI can't handle the use of scheme-types inside C code
- e.g. "my-bool foo(my bool x) { return !x; }".

The type-conversion is always done outside of the C code, the ffi parser
only extracts information from the given code, and never modifies it.

In my actual code I have in C 'typedef unsigned char BOOL', and I was hoping I could somehow convince the FFI parser that the 'BOOL' type should be treated as an unsigned-char-to-be-converted-to/from-boolean. I tried
not letting chicken see the typedef above, but it gets confused.

Hm. I guess you could do some tricks with #define and conditional
compilation (via "#ifndef CHICKEN ...", etc.).


cheers,
felix





reply via email to

[Prev in Thread] Current Thread [Next in Thread]