[gambit-list] 'const' types with ffi

David St-Hilaire sthilaid at iro.umontreal.ca
Wed Sep 12 06:12:58 EDT 2007


Hi all!

How can I represent a 'const int' type within gambit's ffi? Lets say I have the
C funciton:

const int adder(int n){ blablabla...}
and I want to interface that function with a c-lambda, how can I do that? If I
try to omit the 'const' for the parameter's type, I get an error (bad type
convertion) when compiling with g++ ("invalid conversion from ‘const void*’ to
‘void*'")...

I haven't seen anything talking about 'const' types in the ffi documentation...

By the way, I'd like to thank you all for always answering and answering
quickily to all my (and others) questions! It really helps and motivates me to
program in scheme! ^_^

David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20070912/ab4b94de/attachment.sig>


More information about the Gambit-list mailing list