add def arg case, as mentioned in the manual

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7067 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-15 07:40:29 +00:00
commit eb2f355371
2 changed files with 10 additions and 1 deletions

View file

@ -9,3 +9,7 @@ if f.str != "Greetings":
if f.test("Hello") != "Hello":
raise RuntimeError, "Failed"
if varargs.test_def("Hello") != "Hello":
raise RuntimeError, "Failed"

View file

@ -1,12 +1,17 @@
// Tests SWIG's *default* handling of varargs. The default behavior is to simply ignore the varargs.
%module varargs
%inline %{
%varargs(int mode = 0) test_def;
%inline %{
char *test(const char *fmt, ...) {
return (char *) fmt;
}
const char *test_def(const char *fmt, ...) {
return fmt;
}
class Foo {
public:
char *str;