CHANGES.current entry and regression test for previous commit
This commit is contained in:
parent
0c56d0cb72
commit
0ca47dd7cc
4 changed files with 49 additions and 0 deletions
25
Examples/test-suite/newobject3.i
Normal file
25
Examples/test-suite/newobject3.i
Normal 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;
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue