CHANGES.current entry and regression test for previous commit

This commit is contained in:
Olly Betts 2017-10-09 11:09:58 +13:00
commit 0ca47dd7cc
4 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,25 @@
/**
* 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;
}
%}