diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index bc804cfc9..4880c9c2f 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -1833,7 +1833,10 @@ public: Printf(s_oinit, " SWIGTYPE_%s_ce->create_object = %s_object_new;\n", class_name, class_name); Printf(s_oinit, " memcpy(&%s_object_handlers,zend_get_std_object_handlers(), sizeof(zend_object_handlers));\n", class_name); Printf(s_oinit, " %s_object_handlers.clone_obj = NULL;\n", class_name); + // If not defined we aren't wrapping this type being passed or returned. + Printf(s_oinit, "#ifdef SWIGTYPE_p%s\n", SwigType_manglestr(Getattr(n, "classtypeobj"))); Printf(s_oinit, " SWIG_TypeClientData(SWIGTYPE_p%s,SWIGTYPE_%s_ce);\n", SwigType_manglestr(Getattr(n, "classtypeobj")), class_name); + Printf(s_oinit, "#endif\n"); Printf(s_oinit, "}\n\n"); classnode = n;