[cffi-devel] Passing struct by value, kind of

Markus Flambard markus at flambard.se
Sun Jul 27 11:20:46 UTC 2008


Hello lispers!

I know that CFFI doesn't support passing structs by value. What I'm
wondering is, is it possible to squeeze in a small struct by instead
passing it as an int (or something) of the same size as the struct?

Example:

struct MyStruct {
  int32 x, y;
};

int myFunction(struct MyStruct s);

Could I force/lie to CFFI and declare 's' to be of type int64 and pass
it that way?

I tried something similar, but then CFFI (well, ClozureCL) just
couldn't resolve the function symbol..

-- 
Markus Flambard
6A63 2761 0A9E E510 DDAF C796 A3DF AB90 9C7C AD5C



More information about the cffi-devel mailing list