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:
parent
67ca8a4c51
commit
eb2f355371
2 changed files with 10 additions and 1 deletions
|
|
@ -9,3 +9,7 @@ if f.str != "Greetings":
|
||||||
|
|
||||||
if f.test("Hello") != "Hello":
|
if f.test("Hello") != "Hello":
|
||||||
raise RuntimeError, "Failed"
|
raise RuntimeError, "Failed"
|
||||||
|
|
||||||
|
|
||||||
|
if varargs.test_def("Hello") != "Hello":
|
||||||
|
raise RuntimeError, "Failed"
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,17 @@
|
||||||
// Tests SWIG's *default* handling of varargs. The default behavior is to simply ignore the varargs.
|
// Tests SWIG's *default* handling of varargs. The default behavior is to simply ignore the varargs.
|
||||||
%module varargs
|
%module varargs
|
||||||
|
|
||||||
%inline %{
|
%varargs(int mode = 0) test_def;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
char *test(const char *fmt, ...) {
|
char *test(const char *fmt, ...) {
|
||||||
return (char *) fmt;
|
return (char *) fmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *test_def(const char *fmt, ...) {
|
||||||
|
return fmt;
|
||||||
|
}
|
||||||
|
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
char *str;
|
char *str;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue