[Openmcl-devel] Accessing foreign #define'd constants

Denis Bueno dbueno at stygian.net
Wed Dec 22 17:46:48 UTC 2004


On 18 Dec 2004, at 14.00, Denis Bueno wrote:
> On 18 Dec 2004, at 13.29, Denis Bueno wrote:
>
>> I'm trying to write a littl FFI to ioctl(2). As one of its arguments, 
>> it requires some sort of control constant, e.g.
>    <snip>
>
> Bah. Talk about RTFM. I found it in "9.8. Case-sensitivity of foreign 
> names in OpenMCL." Thanks.

So after figuring out how to access foreign constants via the #$ 
read-macro, I ran into additional "cannot find foreign symbol X" 
errors. But I found out my problem.

The problem was that what I had assumed was a C constant was actually a 
#define'd C macro ... so of course I couldn't call it.

I know it's not the responsibility of the openmcl documentation to 
teach people C, but, maybe a little note (in sec. 9.8?) about the 
preferred way to have openmcl call C macros (like by making "glue" via 
a my_macro_call.c file with a my_macro_call() function and calling that 
function from openmcl, or something) would be helpful to anyone who 
runs into this problem in the future. I'm certainly willing to write 
it, if that is acceptable.

Just a thought. =]

--
Denis Bueno
PGP: http://pgp.mit.edu:11371/pks/lookup?search=0xA1B51B4B&op=index
"Acquaintance, n.: A person whom we know well enough to borrow from, 
but not well enough to lend to." - Ambrose Bierce





More information about the Openmcl-devel mailing list