Commit graph

15,137 commits

Author SHA1 Message Date
William S Fulton
fe7a09c04a html fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12686 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-19 06:37:41 +00:00
Stefan Zager
af858d846e Fixes for -builtin docs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12685 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-18 03:25:35 +00:00
William S Fulton
2946576efb Workaround for Octave crashing at extit in the mods and multi_import testcases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12684 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-18 00:29:36 +00:00
Stefan Zager
90d20c7fe8 Cleaned up section about dependency requirements for -builtin.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12683 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 21:53:39 +00:00
William S Fulton
d4ac9ba49d Add release summary
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12682 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 19:47:47 +00:00
William S Fulton
e71624749a Apply #3289851 to fix memory leak in directors when checking for pending exceptions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12681 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 19:15:50 +00:00
William S Fulton
f35dd29dff Apply #3300072 from Christian Delbaere to fix multiple module loading not always sharing variables across modules.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12680 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 18:12:53 +00:00
Xavier Delacour
7e5fa23c5f more CHANGES.current edits
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12679 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 16:11:26 +00:00
Xavier Delacour
e45ba03570 Add CHANGES.current note about octave API>=40 compatability change
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12678 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 16:06:42 +00:00
William S Fulton
df75ceb870 begin section was missing in some of the docs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12677 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 06:38:53 +00:00
William S Fulton
1756036825 Help goes to stdout not stderr
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12676 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 05:47:23 +00:00
Xavier Delacour
06221dacae Allow global operators to be SWIG-wrapped functions (by Karl Wette)
The Octave run-time allows global operators to be implemented,
e.g. op_scalar_add_X for adding a scalar and a wrapped struct X.
However it doesn't currently seem possible for these operators to
map to SWIG-wrapped functions. This is because dispatch_global_op()
looks for the operators to be installed as global variables, whereas
install_global() installs SWIG-wrapped functions as builtin functions;
the two appear to be separate symbol tables in Octave.

This patch modifies install_global() to install global operator functions
as both builtin functions and as global variables, where the value of the
global variable is a function handle to the operator function. It decides
if a function is a global operator if it begins with the prefix "op_"; this
prefix can be modified through a new command-line variable. It also always
installs the operators globally, regardless of whether the rest of the module
is being loaded globally. To accomplish this, install_global() is now always
called, but takes a bool argument specifying whether it should load symbols
globally. If a function is not a global operator, install_global() should
behave as before.

Tested that this compiles and works on Octave 3.2.4 and 3.4.0.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12675 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 02:02:15 +00:00
Xavier Delacour
2d5c4302b0 Adds support for Python __r*__ operators (by Karl Wette)
The Python operator model, when evaluating e.g. x + y, is to call
x.__add__(y), then y.__radd__(x) if the former does not exist, etc.
This patch adds similar functionality to the SWIG runtime code.
For the special case of the comparison operators __l*__ and __g*__,
the reverse operators are __g*__ and __l*__ respectively.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12674 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 02:00:25 +00:00
Xavier Delacour
360c1aaa1b Fix an incompatibility with never versions of Octave (by Karl Wette)
According to the Octave changelog (ChangeLog and src/ChangeLog
in the Octave 3.4.0 source), octave_base_value::map_value() now
returns an octave_map instead of an Octave_map; this change dates
from Octave API version 40 onward. This patch makes the necessary
changes to the SWIG runtime while remaining backward-compatible.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12673 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 01:59:53 +00:00
Xavier Delacour
e22eb83574 Minor improvement to the printing of Octave SWIG classes (by Karl Wette)
Uses Octave's indentation functions to make sure the classes are
printed at the correct indentation level, e.g. for a cell array
containing SWIG-wrapped classes.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12672 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 01:59:19 +00:00
Xavier Delacour
a3689a02fc Fixes to two bugs in Lib/octave/octcomplex.swg (by Karl Wette)
* replace PyObject with octave_value in the SWIG_AsVal(float) fragment

* modify %swig_fromcplx_conv to use the correct Octave constructor for
  double (Complex) and float (FloatComplex)

Also remove an unneeded %ifcplusplus (Octave wrapping code is always in C++).

Checked that %swig_cplxflt_convn now compiles correctly for single-precision
complex values, and that make check-octave-examples passes.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12671 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 01:57:46 +00:00
Xavier Delacour
8848b16e01 Octave changes by Karl Wette:
It's currently not possible to tell SWIG whether or not symbols should be
loaded into the global namespace by default. In fact, it's not even possible
to make the generated .oct module *not* load all symbols globally, due to a
bug in Lib/octave/octruntime.swg (line 37: "noglobal" should be "global").
It's also not possible to change the name of the symbol used to access
global variables/constants from the default "cvar".

This patch adds 3 Octave-specific command-line options:

* -global/-noglobal tell SWIG whether the generated .oct module should load
symbols into the global namespace by default. The default option is -global
to preserve existing behaviour.

* -globals <name> sets the name of the symbol used to access global
variables/constants. It is set to "cvar" by default.

These options are parsed in Source/Modules/octave.cxx, and written to the
wrapping code as the macros SWIG_global_load and SWIG_global_name.

In Lib/octave/octruntime.swg, the Octave entry point DEFUN_DLD function now
contains a expanded input argument parser, which uses the same command-line
arguments (-global/-noglobal, -globals) as can be passed to SWIG itself;
this allows the module user to change the default loading behaviour of the
module user at load time. The parser checks for non-string and unrecognised
arguments, and also checks that the argument to -globals is a valid Octave
identifier. A -help option prints a short usage message.




git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12670 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-17 01:56:43 +00:00
Stefan Zager
cb0a975206 Documented non-looping dependency graph requirement for -builtin.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-16 06:12:15 +00:00
William S Fulton
aac2b5d2e1 Remove VARARGS_SENTINEL typemaps further to revision 12666. Note that the idea of having a named typemap for sentinels is flawed unless the named typemap is provided for every single type in the typemap library.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12668 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-14 23:54:09 +00:00
William S Fulton
830e019a09 HTML fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12667 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-14 01:09:36 +00:00
William S Fulton
74aa3f218f %varargs - better documentation and remove additional argument generation which didn't work properly as a sentinel
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-14 00:13:43 +00:00
William S Fulton
6e87b73c40 reorder tests alphabetically
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12665 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-14 00:11:40 +00:00
William S Fulton
ef1546a287 cosmetic - cleanup
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12664 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-14 00:10:10 +00:00
William S Fulton
d2dd14e628 Python 3.2 portability fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-13 06:01:07 +00:00
William S Fulton
34e7c82631 Remove a compiler warning for builtin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12662 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-13 05:58:58 +00:00
William S Fulton
1aa65e2220 PyVarObject_HEAD_INIT to conform to C standard - pointers cannot be used in static initializers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12661 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-12 21:07:57 +00:00
William S Fulton
63f21af8d0 PyVarObject_HEAD_INIT to conform to C standard - pointers cannot be used in static initializers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12660 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-12 20:20:36 +00:00
Stefan Zager
a52612f845 Fixed PyGetSetDescr for python3.2.
Fixed memory management in special_variable_macros test.

Don't define asdict() for multimap.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-08 06:54:21 +00:00
William S Fulton
cba65bd524 revert 12657 - incorrect changes made
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12658 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-06 21:10:01 +00:00
William S Fulton
769b26d575 Fix %varargs when used with a numerical argument, which was emitting one more optional argument than documented
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12657 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-06 20:56:42 +00:00
William S Fulton
b78392832f [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded method with incorrect arguments improved to show always show fully qualified name and if a const method. Also fixed other Lua error messages in generated code which weren't consistently using the fully qualified C++ name.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-05 06:23:02 +00:00
William S Fulton
0b0b568515 Cosmetic - comments added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12654 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-05 06:09:55 +00:00
William S Fulton
8ee0593036 Remove incomplete directorin typemaps as users incorrectly assumed they were implemented and working
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12653 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:46:00 +00:00
William S Fulton
db9e973ab8 Rev 12650 - rename runtime component of varargs_typemap testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12652 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:38:41 +00:00
William S Fulton
837835280d Remove directorout INPUT/INOUT/OUTPUT typemaps - they will never be used as they used for the return type, not parameters. Fix java directorin typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12651 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:32:13 +00:00
Ian Lance Taylor
045861e9c5 Rename varargs_typemap test case to python_varargs_typemap, and move
to Python Makefile.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12650 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-02 21:11:15 +00:00
Ian Lance Taylor
9958d72275 Document the -soname option.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12649 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-02 21:08:17 +00:00
William S Fulton
8358fd401e vc++ compile failure workaround in testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12648 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-30 20:59:13 +00:00
Ian Lance Taylor
b8d2e9f8f6 Initialize a couple of members accidentally left uninitialized.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12647 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-30 06:02:28 +00:00
Stefan Zager
6bd724dbf9 Added asdict() method to convert std::map to a python dict.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12646 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-29 23:26:55 +00:00
Stefan Zager
a74909f77b Fixed bug 2811549: const vs. non-const iterators for STL types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12645 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-29 22:36:06 +00:00
Stefan Zager
e629b192e2 Fixed the argument counts passed to SWIG_Python_UnpackTuple for varargs.
Removed obsolete methods from std_map.i and pyiterators.swg.

Added builtin-check target to python test suite Makefile.

Fixed using_namespace_loop.i so that the generated wrappers will compile.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12644 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-29 18:25:16 +00:00
Stefan Zager
4b9ef9bc99 Bug 1498929: Access to member fields of map elements.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12643 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-25 21:12:33 +00:00
David Nadlinger
11318bedff Added missing entry for char enum fix in D to CHANGES.current.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12642 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-23 13:34:19 +00:00
David Nadlinger
1dcc81fced [D] nspace: Correctly generate identifiers for base classes when
not in split proxy mode.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12641 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-23 13:34:08 +00:00
Stefan Zager
5fbcb711eb Fix for bug 3286333: infinite recursion with mutual "using namespace" clauses.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12640 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-14 04:22:03 +00:00
Stefan Zager
8f07b3f851 Testcase and fix for bug 1163440: vararg typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12639 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-12 18:55:24 +00:00
Stefan Zager
71a7a52b16 Test case for bug 3285386
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12638 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-12 16:35:09 +00:00
Stefan Zager
cade0f6533 Fixed bug 3285386: parse error from 'operator T*&()'
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12637 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-12 16:34:31 +00:00
William S Fulton
5d062855a7 Fix date ordering - note that most recent changes go to the top of the file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12636 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-11 23:23:41 +00:00