diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-11 09:04:27 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-11 09:04:27 +0000 |
commit | 7f21a7e4087835d9962f0e050d3f424e68bdb0f0 (patch) | |
tree | 1d3ce39137d57791b279368ff60fe1c8866086c1 | |
parent | 66c195b89dddfa65cbb552ee4e3aded9fb5d2889 (diff) | |
download | swig-7f21a7e4087835d9962f0e050d3f424e68bdb0f0.tar.gz |
add typedef case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6857 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | SWIG/Examples/test-suite/primitive_types.i | 15 | ||||
-rw-r--r-- | SWIG/Examples/test-suite/python/primitive_types_runme.py | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/SWIG/Examples/test-suite/primitive_types.i b/SWIG/Examples/test-suite/primitive_types.i index 7ec8547a1..1ba2b3124 100644 --- a/SWIG/Examples/test-suite/primitive_types.i +++ b/SWIG/Examples/test-suite/primitive_types.i @@ -558,6 +558,21 @@ macro(size_t, pfx, sizet) %} +%inline +%{ + namespace DCTypes + { + typedef const unsigned int cuint; + } + + namespace DCSystem + { + using namespace DCTypes; + unsigned int SetPos(cuint& x, cuint& y) {return x + y;} + } +%} + + %apply SWIGTYPE* { char *}; %include "carrays.i" diff --git a/SWIG/Examples/test-suite/python/primitive_types_runme.py b/SWIG/Examples/test-suite/python/primitive_types_runme.py index 96c0aef74..bd357b528 100644 --- a/SWIG/Examples/test-suite/python/primitive_types_runme.py +++ b/SWIG/Examples/test-suite/python/primitive_types_runme.py @@ -353,3 +353,7 @@ s = char_foo(1,"hello") if s !="hello": raise RuntimeError, "bad char* typemap" + +v = SetPos(1,3) +if v !=4: + raise RuntimeError, "bad int typemap" |