swig/Examples/test-suite/newobject3.i
William S Fulton 08210236ef Fix newobject3 testcase
Fixes Octave problem which has a template called product.
2017-10-10 08:05:21 +01:00

25 lines
520 B
OpenEdge ABL

/**
* Regression test for PHP bug: https://sourceforge.net/p/swig/bugs/1350/
*/
%module newobject3
%newobject factory::create;
%inline %{
class Product {};
class factory {
public:
Product * create(short id, short type = 0);
Product * create(const char * name, short type = 0);
};
%}
%{
Product * factory::create(short id, short type) {
return (id && type >= 0) ? new Product : NULL;
}
Product * factory::create(const char * name, short type) {
return (name && type >= 0) ? new Product : NULL;
}
%}