bd2b7fea26
- Update to swig 2.0.4 (see CHANGES.current for complete list) * [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in Perl 5.12 and later. * [Ruby] Fix %import where one of the imported files %include one of the STL include files such as std_vector.i. * [python] Additional fixes for python3.2 support. * [python] Fixed PyGetSetDescr for python3.2. * Bug 2635919: Convenience method to convert std::map to a python dict. * Fixed bug 1163440: vararg typemaps. * [Python] Applied patch #1932484: migrate PyCObject to PyCapsule. * [Python] Merged in the szager-python-builtin branch, adding the -builtin feature for python. The -builtin option may provide a significant performance gain in python wrappers. For full details and limitations, refer to Doc/Manual/Python.html. A small test suite designed to demonstrate the performance gain is in Examples/python/performance. - Fix RHEL/Fedora build OBS-URL: https://build.opensuse.org/request/show/84038 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=23
144 lines
5.1 KiB
Diff
144 lines
5.1 KiB
Diff
diff -wruN -x '*~' ../orig-swig-2.0.4/Lib/python/pycontainer.swg ./Lib/python/pycontainer.swg
|
|
--- ../orig-swig-2.0.4/Lib/python/pycontainer.swg 2011-09-20 12:14:29.000000000 +0200
|
|
+++ ./Lib/python/pycontainer.swg 2011-09-20 12:13:22.000000000 +0200
|
|
@@ -189,7 +189,7 @@
|
|
|
|
namespace swig {
|
|
inline size_t
|
|
- check_index(ptrdiff_t i, size_t size, bool insert = false) {
|
|
+ check_index(std::ptrdiff_t i, size_t size, bool insert = false) {
|
|
if ( i < 0 ) {
|
|
if ((size_t) (-i) <= size)
|
|
return (size_t) (i + size);
|
|
@@ -203,7 +203,7 @@
|
|
}
|
|
|
|
inline size_t
|
|
- slice_index(ptrdiff_t i, size_t size) {
|
|
+ slice_index(std::ptrdiff_t i, size_t size) {
|
|
if ( i < 0 ) {
|
|
if ((size_t) (-i) <= size) {
|
|
return (size_t) (i + size);
|
|
diff -wruN -x '*~' ../orig-swig-2.0.4/Lib/python/pyiterators.swg ./Lib/python/pyiterators.swg
|
|
--- ../orig-swig-2.0.4/Lib/python/pyiterators.swg 2011-04-29 20:25:16.000000000 +0200
|
|
+++ ./Lib/python/pyiterators.swg 2011-09-20 12:14:10.000000000 +0200
|
|
@@ -41,7 +41,7 @@
|
|
}
|
|
|
|
// Random access iterator methods, but not required in Python
|
|
- virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
|
|
+ virtual std::ptrdiff_t distance(const SwigPyIterator &/*x*/) const
|
|
{
|
|
throw std::invalid_argument("operation not supported");
|
|
}
|
|
@@ -78,7 +78,7 @@
|
|
return obj;
|
|
}
|
|
|
|
- SwigPyIterator *advance(ptrdiff_t n)
|
|
+ SwigPyIterator *advance(std::ptrdiff_t n)
|
|
{
|
|
return (n > 0) ? incr(n) : decr(-n);
|
|
}
|
|
@@ -93,27 +93,27 @@
|
|
return ! operator==(x);
|
|
}
|
|
|
|
- SwigPyIterator& operator += (ptrdiff_t n)
|
|
+ SwigPyIterator& operator += (std::ptrdiff_t n)
|
|
{
|
|
return *advance(n);
|
|
}
|
|
|
|
- SwigPyIterator& operator -= (ptrdiff_t n)
|
|
+ SwigPyIterator& operator -= (std::ptrdiff_t n)
|
|
{
|
|
return *advance(-n);
|
|
}
|
|
|
|
- SwigPyIterator* operator + (ptrdiff_t n) const
|
|
+ SwigPyIterator* operator + (std::ptrdiff_t n) const
|
|
{
|
|
return copy()->advance(n);
|
|
}
|
|
|
|
- SwigPyIterator* operator - (ptrdiff_t n) const
|
|
+ SwigPyIterator* operator - (std::ptrdiff_t n) const
|
|
{
|
|
return copy()->advance(-n);
|
|
}
|
|
|
|
- ptrdiff_t operator - (const SwigPyIterator& x) const
|
|
+ std::ptrdiff_t operator - (const SwigPyIterator& x) const
|
|
{
|
|
return x.distance(*this);
|
|
}
|
|
@@ -170,7 +170,7 @@
|
|
}
|
|
}
|
|
|
|
- ptrdiff_t distance(const SwigPyIterator &iter) const
|
|
+ std::ptrdiff_t distance(const SwigPyIterator &iter) const
|
|
{
|
|
const self_type *iters = dynamic_cast<const self_type *>(&iter);
|
|
if (iters) {
|
|
@@ -334,8 +334,8 @@
|
|
Mark methods that return new objects
|
|
*/
|
|
%newobject SwigPyIterator::copy;
|
|
- %newobject SwigPyIterator::operator + (ptrdiff_t n) const;
|
|
- %newobject SwigPyIterator::operator - (ptrdiff_t n) const;
|
|
+ %newobject SwigPyIterator::operator + (std::ptrdiff_t n) const;
|
|
+ %newobject SwigPyIterator::operator - (std::ptrdiff_t n) const;
|
|
|
|
%nodirector SwigPyIterator;
|
|
|
|
@@ -356,11 +356,11 @@
|
|
%catches(swig::stop_iteration) SwigPyIterator::__next__();
|
|
%catches(swig::stop_iteration) SwigPyIterator::next();
|
|
%catches(swig::stop_iteration) SwigPyIterator::previous();
|
|
- %catches(swig::stop_iteration) SwigPyIterator::advance(ptrdiff_t n);
|
|
- %catches(swig::stop_iteration) SwigPyIterator::operator += (ptrdiff_t n);
|
|
- %catches(swig::stop_iteration) SwigPyIterator::operator -= (ptrdiff_t n);
|
|
- %catches(swig::stop_iteration) SwigPyIterator::operator + (ptrdiff_t n) const;
|
|
- %catches(swig::stop_iteration) SwigPyIterator::operator - (ptrdiff_t n) const;
|
|
+ %catches(swig::stop_iteration) SwigPyIterator::advance(std::ptrdiff_t n);
|
|
+ %catches(swig::stop_iteration) SwigPyIterator::operator += (std::ptrdiff_t n);
|
|
+ %catches(swig::stop_iteration) SwigPyIterator::operator -= (std::ptrdiff_t n);
|
|
+ %catches(swig::stop_iteration) SwigPyIterator::operator + (std::ptrdiff_t n) const;
|
|
+ %catches(swig::stop_iteration) SwigPyIterator::operator - (std::ptrdiff_t n) const;
|
|
|
|
struct SwigPyIterator
|
|
{
|
|
@@ -380,7 +380,7 @@
|
|
virtual SwigPyIterator *decr(size_t n = 1);
|
|
|
|
// Random access iterator methods, but not required in Python
|
|
- virtual ptrdiff_t distance(const SwigPyIterator &x) const;
|
|
+ virtual std::ptrdiff_t distance(const SwigPyIterator &x) const;
|
|
|
|
virtual bool equal (const SwigPyIterator &x) const;
|
|
|
|
@@ -390,15 +390,15 @@
|
|
PyObject *next();
|
|
PyObject *__next__();
|
|
PyObject *previous();
|
|
- SwigPyIterator *advance(ptrdiff_t n);
|
|
+ SwigPyIterator *advance(std::ptrdiff_t n);
|
|
|
|
bool operator == (const SwigPyIterator& x) const;
|
|
bool operator != (const SwigPyIterator& x) const;
|
|
- SwigPyIterator& operator += (ptrdiff_t n);
|
|
- SwigPyIterator& operator -= (ptrdiff_t n);
|
|
- SwigPyIterator* operator + (ptrdiff_t n) const;
|
|
- SwigPyIterator* operator - (ptrdiff_t n) const;
|
|
- ptrdiff_t operator - (const SwigPyIterator& x) const;
|
|
+ SwigPyIterator& operator += (std::ptrdiff_t n);
|
|
+ SwigPyIterator& operator -= (std::ptrdiff_t n);
|
|
+ SwigPyIterator* operator + (std::ptrdiff_t n) const;
|
|
+ SwigPyIterator* operator - (std::ptrdiff_t n) const;
|
|
+ std::ptrdiff_t operator - (const SwigPyIterator& x) const;
|
|
};
|
|
}
|
|
|