aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-26 23:04:18 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-26 23:04:18 +0000
commit3041db155db096a39c826deb73ccf44485a38529 (patch)
tree262aaa03bf7bb71616f6fb387af7b6f7b2756f35
parentb266e1f68cedf1601e386ecedca3cce324803661 (diff)
downloadswig-3041db155db096a39c826deb73ccf44485a38529.tar.gz
modifying build system not to rely on the -I path to find the input files avoiding warning 125: merge .i files that are common between python and the main version
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10954 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--Examples/test-suite/li_std_map.i7
-rw-r--r--Examples/test-suite/li_std_set.i6
-rw-r--r--Examples/test-suite/li_std_vector_extra.i (renamed from Examples/test-suite/python/li_std_vector.i)2
-rw-r--r--Examples/test-suite/python/li_std_map.i58
-rw-r--r--Examples/test-suite/python/li_std_set.i17
-rw-r--r--Examples/test-suite/python/li_std_stream.i59
-rw-r--r--Examples/test-suite/python/li_std_vector_extra_runme.py (renamed from Examples/test-suite/python/li_std_vector_runme.py)2
-rw-r--r--Examples/test-suite/python/li_std_wstring.i89
-rw-r--r--Examples/test-suite/python/std_containers.i199
9 files changed, 15 insertions, 424 deletions
diff --git a/Examples/test-suite/li_std_map.i b/Examples/test-suite/li_std_map.i
index edcb05641..806e732ee 100644
--- a/Examples/test-suite/li_std_map.i
+++ b/Examples/test-suite/li_std_map.i
@@ -47,8 +47,15 @@ namespace std
%template(pairiiAc) pair<int,const pair<int, A*> >;
+#ifdef SWIGRUBY
%template() pair< swig::LANGUAGE_OBJ, swig::LANGUAGE_OBJ >;
%template(LanguageMap) map< swig::LANGUAGE_OBJ, swig::LANGUAGE_OBJ >;
+#endif
+
+#ifdef SWIGPYTHON
+ %template() pair<swig::PyObject_ptr, swig::PyObject_ptr>;
+ %template(pymap) map<swig::PyObject_ptr, swig::PyObject_ptr>;
+#endif
}
diff --git a/Examples/test-suite/li_std_set.i b/Examples/test-suite/li_std_set.i
index c2cdc2ebe..6da920a5a 100644
--- a/Examples/test-suite/li_std_set.i
+++ b/Examples/test-suite/li_std_set.i
@@ -31,4 +31,10 @@
+#if defined(SWIGRUBY)
%template(LanguageSet) std::set<swig::LANGUAGE_OBJ>;
+#endif
+
+#if defined(SWIGPYTHON)
+%template(pyset) std::set<swig::PyObject_ptr>;
+#endif
diff --git a/Examples/test-suite/python/li_std_vector.i b/Examples/test-suite/li_std_vector_extra.i
index 06dafce59..17baffe04 100644
--- a/Examples/test-suite/python/li_std_vector.i
+++ b/Examples/test-suite/li_std_vector_extra.i
@@ -1,4 +1,4 @@
-%module li_std_vector
+%module li_std_vector_extra
%warnfilter(509) overloaded1;
%warnfilter(509) overloaded2;
diff --git a/Examples/test-suite/python/li_std_map.i b/Examples/test-suite/python/li_std_map.i
deleted file mode 100644
index a8ba4f2e2..000000000
--- a/Examples/test-suite/python/li_std_map.i
+++ /dev/null
@@ -1,58 +0,0 @@
-%module("templatereduce") li_std_map
-
-%include std_pair.i
-%include std_map.i
-%include std_multimap.i
-
-%inline %{
-struct A{
- int val;
-
- A(int v = 0): val(v)
- {
- }
-
-};
-%}
-
-namespace std
-{
- %template(pairii) pair<int, int>;
- %template(pairAA) pair<int, A>;
- %template(pairA) pair<int, A*>;
- %template(mapA) map<int, A*>;
- %template(mmapA) multimap<int, A*>;
-
- %template(paircA1) pair<const int, A*>;
- %template(paircA2) pair<const int, const A*>;
- %template(pairiiA) pair<int,pair<int, A*> >;
- %template(pairiiAc) pair<int,const pair<int, A*> >;
-
-
- %template() pair<swig::PyObject_ptr, swig::PyObject_ptr>;
- %template(pymap) map<swig::PyObject_ptr, swig::PyObject_ptr>;
-
-}
-
-
-
-%inline
-{
-std::pair<int, A*>
-p_identa(std::pair<int, A*> p) {
- return p;
-}
-
-std::map<int,A*> m_identa(const std::map<int,A*>& v)
-{
- return v;
-}
-
-}
-
-
-
-namespace std
-{
-%template(mapii) map<int,int>;
-}
diff --git a/Examples/test-suite/python/li_std_set.i b/Examples/test-suite/python/li_std_set.i
deleted file mode 100644
index f0fddb058..000000000
--- a/Examples/test-suite/python/li_std_set.i
+++ /dev/null
@@ -1,17 +0,0 @@
-%module li_std_set
-
-%include <std_string.i>
-%include <std_set.i>
-%include <std_multiset.i>
-%include <std_vector.i>
-
-%template(set_string) std::set<std::string>;
-%template(set_int) std::multiset<int>;
-
-
-%template(v_int) std::vector<int>;
-
-
-
-
-%template(pyset) std::set<swig::PyObject_ptr>;
diff --git a/Examples/test-suite/python/li_std_stream.i b/Examples/test-suite/python/li_std_stream.i
deleted file mode 100644
index 0a999ddbf..000000000
--- a/Examples/test-suite/python/li_std_stream.i
+++ /dev/null
@@ -1,59 +0,0 @@
-%module li_std_stream
-
-%inline %{
- struct A;
-%}
-
-%include <std_iostream.i>
-%include <std_sstream.i>
-
-
-
-%callback(1) A::bar;
-
-%inline %{
-
- struct B {
- virtual ~B()
- {
- }
-
- };
-
- struct A : B
- {
- void __add__(int a)
- {
- }
-
- void __add__(double a)
- {
- }
-
- static int bar(int a){
- return a;
- }
-
- static int foo(int a, int (*pf)(int a))
- {
- return pf(a);
- }
-
-
- std::ostream& __rlshift__(std::ostream& out)
- {
- out << "A class";
- return out;
- }
- };
-%}
-
-%extend std::basic_ostream<char>{
- std::basic_ostream<char>&
- operator<<(const A& a)
- {
- *self << "A class";
- return *self;
- }
-}
-
diff --git a/Examples/test-suite/python/li_std_vector_runme.py b/Examples/test-suite/python/li_std_vector_extra_runme.py
index a0d96d4aa..ce7b0c737 100644
--- a/Examples/test-suite/python/li_std_vector_runme.py
+++ b/Examples/test-suite/python/li_std_vector_extra_runme.py
@@ -1,4 +1,4 @@
-from li_std_vector import *
+from li_std_vector_extra import *
iv = IntVector(4)
for i in range(0,4):
diff --git a/Examples/test-suite/python/li_std_wstring.i b/Examples/test-suite/python/li_std_wstring.i
deleted file mode 100644
index c809e11ec..000000000
--- a/Examples/test-suite/python/li_std_wstring.i
+++ /dev/null
@@ -1,89 +0,0 @@
-%module li_std_wstring
-%include <std_basic_string.i>
-%include <std_wstring.i>
-
-
-%inline %{
-
-struct A : std::wstring
-{
- A(const std::wstring& s) : std::wstring(s)
- {
- }
-};
-
-struct B
-{
- B(const std::wstring& s) : cname(0), name(s), a(s)
- {
- }
-
- char *cname;
- std::wstring name;
- A a;
-
-};
-
-
-wchar_t test_wcvalue(wchar_t x) {
- return x;
-}
-
-const wchar_t* test_ccvalue(const wchar_t* x) {
- return x;
-}
-
-wchar_t* test_cvalue(wchar_t* x) {
- return x;
-}
-
-
-std::wstring test_value(std::wstring x) {
- return x;
-}
-
-const std::wstring& test_const_reference(const std::wstring &x) {
- return x;
-}
-
-void test_pointer(std::wstring *x) {
-}
-
-std::wstring *test_pointer_out() {
- static std::wstring x = L"x";
- return &x;
-}
-
-void test_const_pointer(const std::wstring *x) {
-}
-
-const std::wstring *test_const_pointer_out() {
- static std::wstring x = L"x";
- return &x;
-}
-
-void test_reference(std::wstring &x) {
-}
-
-std::wstring& test_reference_out() {
- static std::wstring x = L"x";
- return x;
-}
-
-#if defined(_MSC_VER)
- #pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
-#endif
-
-void test_throw() throw(std::wstring){
- static std::wstring x = L"x";
-
- throw x;
-}
-
-#if defined(_MSC_VER)
- #pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
-#endif
-
-%}
-
-
diff --git a/Examples/test-suite/python/std_containers.i b/Examples/test-suite/python/std_containers.i
deleted file mode 100644
index a1d39e7ab..000000000
--- a/Examples/test-suite/python/std_containers.i
+++ /dev/null
@@ -1,199 +0,0 @@
-%module std_containers
-
-%{
-#include <set>
-%}
-%include std_vector.i
-%include std_string.i
-%include std_deque.i
-%include std_list.i
-%include std_set.i
-%include std_multiset.i
-%include std_pair.i
-%include std_map.i
-%include std_multimap.i
-%include std_complex.i
-
-%template() std::vector<double>;
-%template() std::pair<std::string, int>;
-%template() std::pair<int,double>;
-
-%template() std::vector< std::vector<double > > ;
-%template(ccube) std::vector< std::vector< std::vector<double > > >;
-
-%inline
-{
- typedef
- std::vector<std::vector<std::vector<double > > >
- ccube;
-
- ccube cident(const ccube& c)
- {
- return c;
- }
-
- struct C
- {
- };
-}
-
-
-%template(map_si) std::map<std::string, int>;
-%template(pair_iC) std::pair<int, C*>;
-%template(map_iC) std::map<int, C*>;
-%template(mmap_si) std::multimap<std::string, int>;
-%template(set_i) std::set<int>;
-%template(multiset_i) std::multiset<int>;
-%template(list_i) std::list<int>;
-%template(deque_i) std::deque<int>;
-
-%template(vector_b) std::vector<bool>;
-%template(vector_i) std::vector<int>;
-%template(vector_c) std::vector<std::complex<double> >;
-%template(vector_ui) std::vector<unsigned int>;
-
-%template(bmatrix) std::vector<std::vector<bool> >;
-%template(imatrix) std::vector<std::vector<int> >;
-%template(cmatrix) std::vector<std::vector<std::complex<double> > >;
-
-%apply std::vector<int> *INOUT {std::vector<int> *INOUT2};
-
-%inline
-{
- typedef std::vector<std::vector<int> > imatrix;
- imatrix midenti(const imatrix& v)
- {
- return v;
- }
-
- typedef std::vector<std::vector<bool> > bmatrix;
- bmatrix midentb(const bmatrix& v)
- {
- return v;
- }
-
- std::map<int,C*> mapidentc(const std::map<int,C*>& v)
- {
- return v;
- }
-
- std::map<int,int> mapidenti(const std::map<int,int>& v)
- {
- return v;
- }
-
- std::map<std::string,int> mapident(const std::map<std::string,int>& v)
- {
- return v;
- }
-
- std::multimap<std::string,int> mapident(const std::multimap<std::string,int>& v)
- {
- return v;
- }
-
- std::vector<int> vident(const std::vector<int>& v)
- {
- return v;
- }
-
- std::set<int> sident(const std::set<int>& v)
- {
- return v;
- }
-
- std::vector<unsigned int> videntu(const std::vector<unsigned int>& v)
- {
- return v;
- }
-
-
- int get_elem(const std::vector<int>& v, int index)
- {
- return v[index];
- }
-
- std::pair<int,double> pident(const std::pair<int,double>& p)
- {
- return p;
- }
-
- void
- v_inout(std::vector<int> *INOUT) {
- *INOUT = *INOUT;
- }
-
- void
- v_inout2(std::vector<int> *INOUT, std::vector<int> *INOUT2) {
- std::swap(*INOUT, *INOUT2);
- }
-
-}
-
-
-%{
-
- template <class C> struct Param
- {
- };
-%}
-
-
-template <class C> struct Param
-{
-};
-
-
-%template(Param_c) Param<std::complex<double> >;
-%inline
-{
- int hello(Param<std::complex<double> > c)
- {
- return 0;
- }
-}
-
-%inline
-{
- struct A
- {
- A(int aa = 0) : a(aa)
- {
- }
- int a;
- };
-}
-
-%template() std::pair<A,int>;
-%template(pair_iA) std::pair<int,A>;
-%template(vector_piA) std::vector<std::pair<int,A> >;
-
-
-%inline {
- std::pair<A,int> ident(std::pair<int,A> a, const std::pair<int,int>& b)
- {
- return std::pair<A,int>();
- }
-
-
- std::vector<std::pair<int,A> > pia_vident(std::vector<std::pair<int,A> > a )
- {
- return a;
- }
-
- struct Foo
- {
- Foo(int i) {
- }
- };
-
-}
-
-
-%std_nodefconst_type(Foo);
-
-%template(vector_Foo) std::vector<Foo>;
-%template(deque_Foo) std::deque<Foo>;
-%template(list_Foo) std::list<Foo>;
-
-