Commit graph

2,219 commits

Author SHA1 Message Date
Stefan Zager
2bf6de71b8 bug 3429388: python unsigned integer handling on 32-bit architectures.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12835 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-11-05 03:35:03 +00:00
William S Fulton
24133bacd7 Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-30 21:51:50 +00:00
Robert Stone
fb9750698f mainly for SF bug #3423119
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12828 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-24 20:31:06 +00:00
Xavier Delacour
f8774be92d Allow Octave modules to be re-loaded after a "clear all" (thanks to Karl Wette; SF 3418908)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12824 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-13 23:48:28 +00:00
William S Fulton
91d22324e7 Add support for eLua including options for Lua Tiny RAM (LTR)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12813 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-09-16 22:53:35 +00:00
William S Fulton
2aeed2fd48 Add missing intrusive_ptr csvarout typemaps for C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12807 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-09-13 22:35:14 +00:00
William S Fulton
b00aafcad0 Add boost_intrusive_ptr.i library contribution from #3401571.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12806 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-09-13 19:01:23 +00:00
Robert Stone
7d359b7895 Fix for SF bug #1481958.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12802 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-09-11 01:04:29 +00:00
Xavier Delacour
2f68aa0a34 Added example of friend operator use to Examples/octave/operator, fixed minor bug that causes a panic in octave 3.0.5. Tested examples work for octave 3.0.5, 3.2.4, and 3.4.0. (thanks to Karl Wette)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12794 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-31 20:54:11 +00:00
Xavier Delacour
3372c2ba62 Changes Octave module loading behavior, so that modules can be safely loaded inside functions without first being loaded at the base level. (Basically the module is now always loaded in the base context, and then a local link to the module is created in the current context.) Added an example, module_load, to Examples/octave to test this behaviour in different ways. Tested examples work for octave 3.0.5, 3.2.4, and 3.4.0. (thanks to Karl Wette)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12793 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-31 20:50:59 +00:00
William S Fulton
30206f975c Fix constructors in named typedef class declarations
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12784 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-25 19:27:38 +00:00
Stefan Zager
86e1051a8b Fixed memory leak with --builtin (bug 3385089)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12782 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-22 23:33:17 +00:00
William S Fulton
932f47a845 SF patch #3394339 from Torsten Landschoff - new option -nomoduleglobal to disable installing the module table into the global namespace. Require call also returns the module table instead of a string
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12780 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-22 19:27:56 +00:00
Xavier Delacour
dae9457962 Octave patches for 3.4.0 compatibility, etc. (sf 3387394, thanks for Karl Wette)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12774 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-08 21:41:34 +00:00
William S Fulton
40efa07052 Typemap correction for: (size_t LENGTH, const char *STRING)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12762 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-26 06:27:10 +00:00
Stefan Zager
498367bc9d From swig-user 7/6/11: fix closure for tp_call.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12761 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-20 15:20:24 +00:00
William S Fulton
ff6b144f30 Fix Python directorin typemap for PyObject *
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12760 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-16 14:43:04 +00:00
Stefan Zager
e167400a29 Fixed issue from swig-user 6/27/11.
Support code in std_map.i needs all the template parameters that std::map takes,
even the default ones (Compare, Allocator).



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12759 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-15 18:49:32 +00:00
Olly Betts
688ea24560 [PHP] Fix director code to work when PHP is built with ZTS enabled,
which is the standard configuration on Microsoft Windows.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12749 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-23 16:04:42 +00:00
Mikel Bancroft
b8dcf31539 [allegrocl] Small set of bug fixes and typemap tweaks.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-21 18:51:25 +00:00
Olly Betts
88d540683e [Tcl] Fix variable declarations in middle of blocks which isn't
permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663).
Reported by Paul Obermeier in SF#3288586.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-18 04:24:19 +00:00
William S Fulton
8a6e006a7b Marshalling char[] and char[ANY] to Java byte[] is now a bit easier
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12742 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-17 06:41:53 +00:00
William S Fulton
58e74e8675 Rename python_kwargs testcase to kwargs_feature. Add kwargs_feature to Ruby and fix Ruby warnings when using kwargs feature. Add %kwargs macro for Ruby
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12739 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-13 17:38:08 +00:00
Stefan Zager
3cb76bb45e Slight tweak to output typemap for int
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12738 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-11 05:49:49 +00:00
William S Fulton
3243cbaad4 Numerous autodoc fixes for Python
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12735 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-10 19:33:40 +00:00
Stefan Zager
50425dc95e For all long integer types, use PyLong_From* rather than PyInt_From*
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12732 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-03 18:42:38 +00:00
Olly Betts
b0ffa0b48f Fix comment typos
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12729 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-03 13:13:44 +00:00
Olly Betts
a09225e70b Need to cast away const-ness for the PHP API.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12724 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 06:58:26 +00:00
Olly Betts
29190559f8 SWIG_ZTS_SetPointerZval() now interprets bit 1 in newobject as meaning (wrap
in a PHP class wrapper), rather than taking newobject==2 as meaning this,
so we can wrap new and existing objects in this way.

Handle wrapping classes in a C++ namespace being returned by director methods.

No need to force classname to lowercase as zend_lookup_class() does that
internally.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12723 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 06:47:47 +00:00
Olly Betts
4c64a731c8 Avoid pointless creation of a PHP string
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 04:37:49 +00:00
Olly Betts
75a317d746 Fix typo in UEH message
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12720 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-27 13:57:42 +00:00
William S Fulton
924be5044d cosmetic style fix on pointer declarations
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12716 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-25 17:13:45 +00:00
Olly Betts
f38530b490 Make a char * pointer we don't modify through const.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12710 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-24 03:59:35 +00:00
William S Fulton
ac06518319 Patch #3191625 fixing overloading of integer types.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12692 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-19 19:49:48 +00:00
William S Fulton
ea00ff974f Patch #3260265 fixing overloading of non-primitive types and integers in Perl 5.12 and later
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-19 19:31:39 +00:00
William S Fulton
f8270079eb remove unused macro
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-19 06:44:17 +00:00
William S Fulton
dfa13b658e Fix import_stl testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12688 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-19 06:42:56 +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
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
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
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
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