[PHP] Stop generating a bogus line of code in certain constructors.

This was mostly harmless, but caused a PHP notice to be issued, if
enabled (SF#2985684).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2010-05-21 07:07:15 +00:00
commit e512093358
2 changed files with 13 additions and 6 deletions

View file

@ -1,6 +1,11 @@
Version 2.0.0 (in progress) Version 2.0.0 (in progress)
============================ ============================
2010-05-21: olly
[PHP] Stop generating a bogus line of code in certain constructors.
This was mostly harmless, but caused a PHP notice to be issued, if
enabled (SF#2985684).
2010-05-18: wsfulton 2010-05-18: wsfulton
[Java] Fix member pointers on 64 bit platforms. [Java] Fix member pointers on 64 bit platforms.

View file

@ -1631,12 +1631,14 @@ public:
Printf(output, "%s", prepare); Printf(output, "%s", prepare);
if (constructor) { if (constructor) {
if (!directorsEnabled() || !Swig_directorclass(n)) { if (!directorsEnabled() || !Swig_directorclass(n)) {
if (!Len(prepare)) {
if (strcmp(methodname, "__construct") == 0) { if (strcmp(methodname, "__construct") == 0) {
Printf(output, "\t\t$this->%s=%s;\n", SWIG_PTR, invoke); Printf(output, "\t\t$this->%s=%s;\n", SWIG_PTR, invoke);
} else { } else {
String *classname = Swig_class_name(current_class); String *classname = Swig_class_name(current_class);
Printf(output, "\t\treturn new %s(%s);\n", classname, invoke); Printf(output, "\t\treturn new %s(%s);\n", classname, invoke);
} }
}
} else { } else {
Node *parent = Swig_methodclass(n); Node *parent = Swig_methodclass(n);
String *classname = Swig_class_name(parent); String *classname = Swig_class_name(parent);