RE: callbacks with pass-by-value struct args

  • From: "Janis Britals" <jbritals@xxxxxxxxx>
  • To: <luajit@xxxxxxxxxxxxx>
  • Date: Thu, 27 Mar 2014 11:44:07 +0100

> Do you have any plans to support callbacks with pass-by-value struct args
in the future?
> This is a show-stopper for bridging Cocoa via ffi because subclassing is
done via callbacks and a few essential methods have pass-by-value struct
args.

You can easily work around this problem: write a thin wrapper in C that
passes the pointer to the received struct argument to a second callback,
which you can bind now with ffi. I had the same problem with binding some
virtual calls from Qt and it works perfectly.


Other related posts: