summaryrefslogtreecommitdiff
path: root/Examples/test-suite/overload_extend.i
diff options
context:
space:
mode:
authorMarcelo Matus <mmatus@acms.arizona.edu>2004-10-06 17:32:03 +0000
committerMarcelo Matus <mmatus@acms.arizona.edu>2004-10-06 17:32:03 +0000
commit200111d52d9bc951d198554ca4877524e1d6f012 (patch)
tree90ed47aa6c27c7c1e3fb02a18a672b4bb5716e59 /Examples/test-suite/overload_extend.i
parent2feaa15679bb6b13adc87870be1512a825b59860 (diff)
downloadswig-200111d52d9bc951d198554ca4877524e1d6f012.tar.gz
more cases, and C/C++ compatibility
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6349 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/overload_extend.i')
-rw-r--r--Examples/test-suite/overload_extend.i8
1 files changed, 6 insertions, 2 deletions
diff --git a/Examples/test-suite/overload_extend.i b/Examples/test-suite/overload_extend.i
index a892fd9a4..65206c359 100644
--- a/Examples/test-suite/overload_extend.i
+++ b/Examples/test-suite/overload_extend.i
@@ -1,14 +1,18 @@
%module overload_extend
+#ifndef __cplusplus
+%typemap(default) double y "$1=1000;";
+#endif
+
#pragma SWIG nowarn=-302
%extend Foo {
int test() { return 0; }
int test(int x) { x = 0; return 1; }
int test(char *s) { s = 0; return 2; }
#ifdef __cplusplus
- int test(double x, double y = 0) { x = 0; y = 0; return 3; }
+ double test(double x, double y = 1000) { return x + y; }
#else
- int test(double x, double y) { x = 0; y = 0; return 3; }
+ double test(double x, double y) { return x + y; }
#endif
};