jaeandersson / swig

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
http://www.swig.org
Other
23 stars 19 forks source link

Add support for directors #30

Open jgillis opened 9 years ago

KrisThielemans commented 9 years ago

thanks for this. I have a few compilation errors when running the test-suite. One of this is related to the fact that you're calling error() (3 times, e.g. in wrapConstructor). However, that's an Octave function that doesn't exist in MATLAB. I no longer get compilation errors when using

mexErrMsgIdAndTxt(\"SWIG:RuntimeError\",errortext);

but I'm not 100% sure if this is what is needed. What do you think?

KrisThielemans commented 9 years ago

apologies. The code in wrapConstructor was fine. This error is only in MATLAB::MATLAB when writing to the director_prot_ctor_code (L272 of matlab.cxx)

KrisThielemans commented 9 years ago

I've now commited this and one other fix in my fork. The other fix adds some "const" to member functions. This now makes quite a lot more test cases compile (and a few more run...).

you can find it on

https://github.com/KrisThielemans/swig/tree/director_fixes

Sadly, I'm still not used to pull requests, so this branch also contains updates from Pull Request #41

jaeandersson commented 9 years ago

I've pulled your changes. @jgillis - close?

KrisThielemans commented 9 years ago

thanks! There's still quite a lot of failures in the test-suite related to directors. And @jgillis mentioned a memory leak. So I guess we cannot close this issue yet?

jaeandersson commented 9 years ago

Looks like directors now only work when there is exactly one output. I tried to use it with a function with void return and it failed.

jaeandersson commented 9 years ago

The director code really needs cleanup for maintainability.

jgillis commented 7 years ago

Design can be refactored using mxCalloc/mexMakeMemoryPersistent

jaeandersson commented 7 years ago

Interesting. Will you take a shot at it?

KrisThielemans commented 3 years ago

Most of the director support seems to work, but there are still 2 failures after #96.