Commit graph

16,009 commits

Author SHA1 Message Date
Olly Betts
6efe3d61f2 Strip trailing whitespace 2013-08-29 11:16:58 +12:00
William S Fulton
b58dabced9 %implicitconv is improved for overloaded functions.
Like in C++, the methods with the actual types are considered before trying implicit conversions.
2013-08-28 20:30:46 +01:00
William S Fulton
1cc735df5e %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
Problem highlighted by Bo Peng on the swig-user mailing list. SF patch #230.
2013-08-28 20:28:15 +01:00
Olly Betts
628b4710e5 [Python] Fix clang++ warning in generated wrapper code. 2013-08-24 08:40:08 +12:00
Olly Betts
b477cb66be Use offsetof() rather than icky homemade equivalent 2013-08-24 08:34:50 +12:00
Kris Thielemans
a495b5a985 Remove SwigPyObject_print and SwigPyObject_str, and make the generated wrapper use the default python implementations, which will fall back to repr (for -builtin option).
Advantages:
- it avoids the swig user having to jump through hoops to get print to
  work as expected when redefining repr/str slots.
- typing the name of a variable on the python prompt now prints the
  result of a (possibly redefined) repr, without the swig user having to
do any extra work.
- when redefining repr, the swig user doesn't necessarily have to
  redefine str as it will call the redefined repr
- the behaviour is exactly the same as without the -builtin option while
  requiring no extra work by the user (aside from adding the
%feature("python:slot...) statements of course)
- the patch simplifies pyrun.swg a tiny bit.

Disadvantage:
- default str() will give different (but clearer?) output on swigged
  classes compared to unpatched swig

SF Bug #326
2013-08-07 20:22:03 +01:00
William S Fulton
a0af86811d Travis builds - add in apt-get update
php tests were failing. Travis suggest running this before any install - http://about.travis-ci.org/docs/user/build-configuration/#Installing-Packages-Using-apt
2013-08-06 21:16:11 +01:00
William S Fulton
80f8d1d922 Fix for missing C++ code in std::multimap wrappers.
%template for a std::multimap generated uncompilable code unless a
%template for a std::map of the same template types was also coded up.

This patch is needed in conjunction with previous commit - 5f1fff1849

Closes #64
Closes #65
2013-08-06 07:02:49 +01:00
Andrew Simmons
5f1fff1849 Copied std::pair<> fragment from Lib/std/std_map.i into Lib/std/std_multimap.i. This fixes an error when a std::multimap template is wrapped by itself. 2013-07-25 18:23:45 +01:00
William S Fulton
83178a1fe4 Correction for detecting invalid Octave options 2013-07-16 23:05:59 +01:00
Karl Wette
b28de20869 Octave: fixups to previous configuration patch
- remove unneeded test -n "$OCTAVE"
- do not rely on Octave returning non-zero status for unrecognised option;
  search first line of output for 'unrecognized' instead
2013-07-16 20:59:50 +01:00
Karl Wette
479df82616 Octave: more robust configuration
- do not rely on --eval argument to find mkoctfile, instead assume it
  is in the same directory as octave itself (which it always should be)
- check Octave options to make sure they are supported, including
  --no-window-system to prevent warnings if building without an X server
- disable Octave if any vital tests fail
2013-07-16 20:59:50 +01:00
joequant
e8c6384f77 add regression tests for SEXP return values 2013-07-14 20:29:37 +08:00
joequant
93b63969f9 change to allow file SEXP return values 2013-07-14 20:28:17 +08:00
William S Fulton
d0af4f50d3 Add %pythonbegin directive.
For adding code at the beginning of the generated .py file.
2013-07-05 06:30:16 +01:00
William S Fulton
eb98c0be99 Correct dates in recent commits to CHANGES file 2013-07-05 06:25:07 +01:00
William S Fulton
1c44078751 Improve testing of %pythonprepend and %pythonappend 2013-07-02 20:00:17 +01:00
William S Fulton
ace8fcd972 SWIG_AsWCharPtrAndSize improper operation if cptr NULL
SF bug #1327

This doesn't have any noticeable effect with the usage of
SWIG_AsWCharPtrAndSize as shipped by SWIG, but could be a problem if a
user is using this function with cptr equal to zero and psize is non-zero
 - the length would be incorrectly set due to the call to PyUnicode_GetSize
failing.
2013-07-02 18:58:56 +01:00
Olly Betts
d3252bbf7f Fix comment typo 2013-07-02 13:22:35 +12:00
Olly Betts
c8a879303c Fix comment typo (interpeters) 2013-07-02 12:29:28 +12:00
William S Fulton
112d7aa6d0 Go examples and test-suite format fixes
Patch has the results of find . -name *.go -exec gofmt -w {} \;

SF Patch #339.
2013-07-01 20:13:36 +01:00
William S Fulton
7491be12e5 Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr when using -builtin.
SF patch #340
2013-07-01 20:09:31 +01:00
William S Fulton
779dc402b6 Fix a const_cast in generated code that was generating a <:: digraph when using the unary scope operator (::) (global scope) in a template type.
Affects Python, Ruby, Ocaml.

Based on SF patch #341.
2013-07-01 20:00:12 +01:00
William S Fulton
0058eea3ad Add SF patch #342 fix some director classes crashing on object deletion when using -builtin.
Fixes SF bug #1301 and python test cases director_basic and
director_classic seg faulting when used with -builtin.

Patch from Christian Delbaere.
2013-07-01 19:25:34 +01:00
Karl Wette
d72e3dd899 Octave: add SWIGRUNTIMEINLINE to SWIG_Octave_SetConstant() 2013-06-13 17:46:47 +02:00
Karl Wette
0d05b2a2d1 Octave: make texinfo strings static (internal linkage) 2013-06-13 17:46:34 +02:00
William S Fulton
7f95c7bb3e Use a less confusing macro name, SWIG_PYTHON_NO_DEBUG => SWIG_PYTHON_INTERPRETER_NO_DEBUG 2013-06-11 19:15:57 +01:00
William S Fulton
5cdfc503e1 Add SWIG_PYTHON_NO_DEBUG macro for building Debug wrappers against the Python Debug dll 2013-06-11 00:22:21 -07:00
William S Fulton
abc27fd157 Further Ruby html doc formatting changes 2013-06-08 02:00:47 +01:00
William S Fulton
66599db01d Ruby html docs formatting - modify code snippets to be same as other chapters 2013-06-08 01:41:16 +01:00
William S Fulton
a7515a725e Remove use of monospace in Ruby docs and unncessary usage of <br> 2013-06-08 00:37:38 +01:00
William S Fulton
5766f19132 Remove lines with just spaces on them in Ruby docs 2013-06-08 00:37:15 +01:00
William S Fulton
3834036e13 Fix Ruby regression with missing rb_complex_new function.
Affects Ruby versions prior to 1.9 using std::complex wrappers if just using std::complex
as an output type. Also fix the Complex helper functions external visibility (to static by default).

Closes #52
2013-06-07 19:56:38 +01:00
Paweł Tomulik
c9295401da clean all .py files generated by python-test-suite
Closes #49
2013-06-04 22:23:53 +01:00
Olly Betts
abfa75b169 [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
if the type lookup fails.
2013-06-04 12:53:27 +12:00
Olly Betts
918c64af84 Fix comment typos 2013-06-04 12:44:28 +12:00
William S Fulton
8e89cad271 Bump version to 2.0.11 2013-05-27 20:27:50 +01:00
William S Fulton
1524d02e13 Add swig-2.0.10 release date and release notes 2013-05-27 19:24:04 +01:00
William S Fulton
72f2d8ac8f Fix Python test-suite makefile to show which tests have runtime tests (for Python 3). 2013-05-27 10:24:02 +01:00
William S Fulton
af8f77a627 Fix to ensure 2to3 for Python 3 examples is run 2013-05-27 00:27:31 +01:00
William S Fulton
2004b9fc03 Add Python 3 Travis tests 2013-05-26 23:58:12 +01:00
William S Fulton
b3ca22dc33 Fix Python examples to compile and run under Python 3 2013-05-26 23:02:13 +01:00
William S Fulton
fd93beadf4 Fix 'make check-python-test-suite PY3=1' and -j (make jobs) 2013-05-25 22:29:18 +01:00
William S Fulton
5481270c2a Fix Python 3 inconsistency handling -ve numbers for unsigned C types.
An OverFlow error is now consistently thrown instead of a TypeError.

Fixes primitive_types testcase for Python 3
2013-05-25 10:36:14 +01:00
Artem Serebriyskiy
3e188e508d Add test case for attributes with moderately complex templates
* New test case tests that %attribute macros correctly supports passing
  template with multiple parameters as class name or attribute type name

* Some further changes were made to %attribute macros - now
  AttributeType is protected with %arg as well. This allows you
  to have attributes of type e.g. std::pair<int,int> etc

Update CHANGES file for %attribute template fixes

Closes #48
2013-05-25 00:44:36 +01:00
Artem Serebriyskiy
c956c4c87f Fix %arg in Lib/attribute.i 2013-05-25 00:37:57 +01:00
Artem Serebriyskiy
3357ee85cd Fix all attributes macroses 2013-05-25 00:37:57 +01:00
William S Fulton
030b97c891 Documentation sectioning update 2013-05-25 00:15:48 +01:00
William S Fulton
f15eb3f5ec Fix vararg documentation for Python 3
Memory handling is different to Python 2.
2013-05-24 23:02:34 +01:00
William S Fulton
074c0039db Fix Python version checking in Python tests 2013-05-24 18:57:26 +01:00