Commit graph

549 commits

Author SHA1 Message Date
Vadim Zeitlin
ed28725a15 Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
These typemaps are currently defined for C#, Java and Python only and the
tests are provided only for these languages.

Also add a brief description of the new header to the documentation.
2013-12-03 23:45:20 +01:00
Vadim Zeitlin
72afb74f47 Add support for case conversion characters in regex substitutions.
Allow using Perl-like \l, \L, \u, \U and \E escape sequences in the
substitution string used with %rename("%(regex:/pattern/subst/)s").
This is useful for e.g. title casing all string after removing some prefix.

Closes #82
2013-10-15 07:17:56 +01:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
William S Fulton
738cc36aab Rename all C++0x to C++11 and cpp0x to cpp11 2013-10-07 20:37:00 +01:00
William S Fulton
a91cd0bc5c Infinity is now by default an acceptable value for type 'float'.
This fix makes the handling of type 'float' and 'double' the same. The implementation requires the
C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
2013-09-12 07:28:12 +01: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
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
Paweł Tomulik
c9295401da clean all .py files generated by python-test-suite
Closes #49
2013-06-04 22:23:53 +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
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
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
William S Fulton
0f1e3da5de Fix the high passed to PyTuple_GetSlice in varargs wrappers.
Harmless bug as slices can take any size larger than the actual size for
the high value. Reported in SF Bug 1326.
2013-05-23 21:25:41 +01:00
William S Fulton
f68cde8bb9 Fix li_std_containers_int test case for Python < 2.6
Workaround bugs in older versions of Python
2013-05-03 19:55:42 +01:00
Jesus Lopez
9be3235988 Support $descriptor() macro in fragments
Closes #36
2013-04-18 23:04:07 +01:00
William S Fulton
5878ca5f1a Fix autodoc test for python 2.4 2013-03-29 09:20:17 +00:00
William S Fulton
b504b68a62 Fix erratically failing threads_exception python test 2013-03-26 20:57:41 +00:00
William S Fulton
8778724768 Add support for extern "C++" - no warning should be issued as was previously occurring 2013-02-08 18:55:16 +00:00
William S Fulton
e44656cfe5 Add support for extern "C" thread_local 2013-02-08 18:45:29 +00:00
William S Fulton
b725625e6f Add support for thread_local when specified with other legitimate storage class specifiers - extern and static 2013-02-08 06:36:39 +00:00
William S Fulton
d613ef42f2 Rework std::initializer_list handling to warn about usage in any method, not just constructors. A typemap is used to issue the warning and can be overridden with user defined behaviour. 2013-02-04 20:03:22 +00:00
William S Fulton
c8ff23de0c Initialization list doc updates and new tests. Fix functions with default arguments that are initializer lists 2013-02-02 20:03:10 +00:00
William S Fulton
a043b55b69 Better clarification about polymorphic wrappers for function objects - std::function 2013-02-01 19:17:21 +00:00
William S Fulton
2a90cc6a98 Remove generated output that should not be checked in2 2013-01-28 07:11:08 +00:00
William S Fulton
e805d5f925 Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up

Conflicts:
	Doc/Devel/engineering.html
	Examples/Makefile.in
	Lib/allegrocl/allegrocl.swg
	Lib/csharp/csharp.swg
	Lib/csharp/enums.swg
	Lib/csharp/enumsimple.swg
	Lib/csharp/enumtypesafe.swg
	Lib/java/java.swg
	Lib/python/pydocs.swg
	Lib/r/rtype.swg
	Source/Include/swigwarn.h
	Source/Modules/octave.cxx
	Source/Modules/python.cxx
	Source/Modules/ruby.cxx
	Source/Swig/scanner.c
	Source/Swig/stype.c
	Source/Swig/swig.h
	configure.ac
2013-01-28 07:01:37 +00:00
Paweł Tomulik
da00bdb12d added python test case li_std_except_as_class for SF bug 1295 2013-01-04 15:43:44 +01:00
William S Fulton
ba575159f6 Add runtime test for %implicitconv
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13950 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-08 10:37:04 +00:00
William S Fulton
e25da884cb Fix unrestricted unions testcase and add runtime example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13849 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-21 19:15:44 +00:00
William S Fulton
049035ff3e Add discard and add methods to std::set and std::multiset wrappers so that pyabc.i can be used ensuring MutableSet is a valid abstract base class
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13619 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-15 22:36:15 +00:00
William S Fulton
54726b9d09 Fix using declarations and templates. %template was putting the
instantiated template into the global namespace instead of the namespace
of the template definition. This fixes regression in swig-2.0.5 copying
the std::pair typemaps which occurs with a 'using std::pair'
declaration. This also fixes lots of other using declarations of
template problems (template forward declarations. combinations
using directives).

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13504 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-04 20:24:22 +00:00
William S Fulton
73b0431fbc Fix C enum forward declarations in some target languages (notably Java)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13030 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-01 18:44:22 +00:00
William S Fulton
117cb9b74a Fix a few warnings/errors in the test-suite using Solaris compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12993 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-15 21:56:38 +00:00
William S Fulton
f00a41093c As std_list.i is not available in many language, put this python specific test just in Python makefile
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12986 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-14 21:11:19 +00:00
William S Fulton
df4f9adf0a Diagnostics for erratically failing test case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12984 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-14 20:29:22 +00:00
William S Fulton
e8aab00b6d Remove run tests which should have been done in rev 12953 (reverting %shared_ptr fixes with typedef)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12982 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-14 17:01:39 +00:00
William S Fulton
50693941c6 Fix #3475492 - iterating through std::vector wrappers of enumerations.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12916 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-13 07:10:24 +00:00
William S Fulton
7c58a044d2 Add support for negative steps in Python slices on the STL containers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12903 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-01-24 23:41:40 +00:00
William S Fulton
6ee6278bc5 Add runtime testcase for python slicing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12902 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-01-24 20:38:50 +00:00
William S Fulton
c794d08597 Fix %newobject when used in conjunction with %feature(ref). The code from the ref feature was not always being generated for the function specified by %newobject. Documentation for ref and unref moved from Python to the C++ chapter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12783 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-23 19:29:10 +00:00
William S Fulton
d0081ebb82 %shared_ptr fixes when the type is a template using template parameters that are typedef'd to another type. Also fixed %shared_ptr when the template parameter has a default value.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12776 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-13 00:36:12 +00:00
William S Fulton
7d038d4bd7 Fix scoping of forward class declarations nested within a class (for C++). Also fix %template and resolution of template parameters that are typedefs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-26 19:34:23 +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
William S Fulton
6c100423b8 Fix some scope and symbol lookup problems when template default parameters are being used with typedef - add the fully expanded template into the c symbol table and scope table.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12754 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-01 22:59:55 +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
William S Fulton
665b70e887 Change test to fail rather than print a message
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12737 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-10 22:48:32 +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