Commit graph

29 commits

Author SHA1 Message Date
Olly Betts
c8a7322a4d Use %{ %} instead of { } after %pythoncode
Simpler and safer change to address PR#357.
2015-03-20 13:45:19 +13:00
Julien Schueller
0d589349a1 Fixed pep8 issues E701, E203, E231, E261 2014-06-06 11:03:46 +02:00
William S Fulton
347f2782d2 Fix missing stddef.h when %import of STL containers. Was causing compile failures witht g++-4.6.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12939 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-20 20:07:56 +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
William S Fulton
fd666c1440 new %import test for vector
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12633 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-11 21:28:06 +00:00
Stefan Zager
3d444101d1 A slew of changes based on William Fulton's code review.
- Fixed naming conventions; SwigPyBuiltin is used a lot
- Removed use of std::vector
- builtin.swg isn't included if -builtin isn't specified
- Changed many feature names to use a "python:" prefix
- Eliminated static vars in std_pair.i
- Eliminated C++-style comments (//)
- Enabled autodoc and docstring with -builtin
- Fixed non-ansi generated C code
- Detect and complain if two incompatible swig modules are loaded
- Removed argcargvtest_runme3.py, and fixed argcargvtest_runme.py
  so that 2to3 handles it better
- Removed anonymous namespaces
- Eliminated builtin_init typemaps; consolidated functionality into
  SWIG_Python_NewPointerObj
- Eliminate printf warnings from %U conversion character by switching
  to %S, which works just as well
- Fixed li_std_set_runme.py for python3, which returns set members in
  a different order from python2





git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12562 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-29 06:57:02 +00:00
Stefan Zager
288c37f5bf Regressions pass! With a few tweaks for unsupported features, primarily:
- Throwing wrapped types as exceptions is unsupported.
- Reverse comparison operators (e.g., __radd__) aren't supported.

Rationalized destructors.

Finished std::map implementation.  Required fixes to typecheck for
SWIGTYPE* const&.

Need a little special handling of the swig_type_info for SwigPyObject
when multiple modules are loaded.

Fall back to SwigPyObject_richcompare if there's no operator overload.

"memberget" and "memberset" attrs are applied strangely; work around
them.

Added 'this' attribute.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12415 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-30 03:17:28 +00:00
Stefan Zager
dd465f9588 Finished std::pair and std::map support.
li_std_pair_extra test fails, because the _runme.py uses the
secret 'this' member variable, which doesn't exist when the
-builtin option is used.  Seems like a flaw in the test.

Test suite now fails on li_std_string_extra, because static
member variables are not fully implemented.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12351 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-15 23:04:20 +00:00
Stefan Zager
ee3a6623da First cut. Works for wrapping OpenAccess, but there's plenty
left to do.

Currently, the test suite hurls at director_stl.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/szager-python-builtin@12332 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-07 21:50:00 +00:00
William S Fulton
4308dd03cf SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:26:02 +00:00
Olly Betts
6d8ea4f7fa Fix comment typos
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11193 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-04-29 12:00:38 +00:00
Haoyu Bai
8f84447860 Commited SF#2158938: change all SWIG symbols start with Py to a new name.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10961 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-12-03 18:43:44 +00:00
Haoyu Bai
3d8ddfc442 Merged the Python 3.0 support branch. The merging progress is not so smooth, so hope this commit won't make anything broken.
This is the (incomplemete) log produced by svnmerge.py:

Merged revisions 10405-10409,10420-10422,10426,10438,10445,10451,10454-10465,10467,10473-10475,10485,10488-10489,10493-10495,10497,10509-10510,10513-10514,10517,10520,10525,10528-10529,10533-10535,10554-10557,10570,10573,10593,10614,10666-10669,10673,10678,10687,10690,10704-10706,10731,10744,10750-10752,10755,10759,10770,10775-10776,10813,10819 via svnmerge from 
https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-bhy



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10834 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-11 17:18:07 +00:00
William S Fulton
1213c5640a Fix unused parameter warnings in python when using gcc's -W -Wall options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10547 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-06-21 22:25:36 +00:00
William S Fulton
a1100e9964 Thread safety patch for Python STL iterators from Abhinandan Jain
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10317 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-03-21 23:11:24 +00:00
William S Fulton
c74b246a95 Common template for head of each file detailing licence, distribution and authors information
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8975 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-03-07 00:35:17 +00:00
Marcelo Matus
a66fa50a8c cosmetic for generated python code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8850 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-20 07:33:18 +00:00
Marcelo Matus
1e2e004b4a fix %import problem reported by Eric Blossom
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-06 03:58:58 +00:00
Marcelo Matus
45a045b9f1 fix for solaris + no stlport4
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8668 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-01 16:24:23 +00:00
Marcelo Matus
32d28239da set PyObject * out typemaps back to simple returns
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8584 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-28 03:38:05 +00:00
William S Fulton
b332cb768d Choose SWIG exception specification override (%catches) instead of real exception specifications for code that goes into the wrappers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8398 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-12 23:01:54 +00:00
William S Fulton
f11ecbe8fd remove unnecessary exception specifications, thereby preventing Visual Studio from having epileptic warnings fits filling the screen with heaps of compete and utter rubbish because it doesn't handle exception specifications properly.
Marcelo, please check that this doesn't remove any generated catch handlers. I dont' feel up to chasing a million and one macros to be sure.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8397 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-12 22:36:04 +00:00
Marcelo Matus
5daf66c0db fix memory PyObject * typemaps to avoid memory leaks with iterators
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-11 23:05:12 +00:00
Marcelo Matus
2bde7c2c3b map iterators now use the native PySwigIterator, which is very very good for large maps, since no more temporals key/value tuples are needed
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8311 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-09 00:40:44 +00:00
Marcelo Matus
b3a4f3382e fix iterators for old compilers
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8240 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-06 02:28:01 +00:00
Marcelo Matus
c8d5ba81eb add %nodirector to internal PySwigIterator class
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8214 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-04 20:22:44 +00:00
Marcelo Matus
ebe7889ea9 no need for , use
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8118 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-28 23:23:42 +00:00
Marcelo Matus
1657c18b67 add the label for use inside typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8087 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-27 21:41:03 +00:00
Marcelo Matus
984ecc3d4f move iterator classes to pyiterator and add/test std_carray.i class
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8010 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-19 10:43:26 +00:00