Declare Octave public wrapping functions with DEFUNX_DLD

- New helper function Octave_begin_function writes function declaration
  and installer function definition using SWIG_DEFUN macro, which in
  turn uses Octave DEFUNX_DLD macro
- Can now use Octave's dynamic module loader to load functions safely
- Link documentation of public wrapping functions through DEFUNX_DLD

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13087 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Karl Wette 2012-05-14 09:24:00 +00:00
commit 4f11aaa849
2 changed files with 59 additions and 28 deletions

View file

@ -14,6 +14,12 @@
#endif
#if OCTAVE_API_VERSION_NUMBER < 37
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc)
#else
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc)
#endif
SWIGRUNTIME bool SWIG_check_num_args(const char *func_name, int num_args, int max_args, int min_args, int varargs) {
if (num_args > max_args && !varargs)
error("function %s takes at most %i arguments", func_name, max_args);