swig/Examples/test-suite/varargs.i
William S Fulton 346e766e31 beefed up varargs test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4577 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-19 20:48:52 +00:00

28 lines
493 B
OpenEdge ABL

// Tests SWIG's *default* handling of varargs. The default behavior is to simply ignore the varargs.
%module varargs
%inline %{
char *test(const char *fmt, ...) {
return (char *) fmt;
}
class Foo {
public:
char *str;
Foo() {
str = NULL;
}
Foo(const char *fmt, ...) {
str = new char[strlen(fmt) + 1];
strcpy(str, fmt);
}
~Foo() {
delete [] str;
}
char *test(const char *fmt, ...) {
return (char *) fmt;
}
};
%}