Temporary workaround for testcase failing in PHP

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13968 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-12-15 12:46:04 +00:00
commit ca61d10d9b

View file

@ -13,6 +13,24 @@
// Can't use the %typemap(directorout) MyType & = SWIGTYPE & approach as non-director languages don't define any directorout typemaps
%typemap(directorout) MyType &Class1::foo2, MyType &foo1 %{ /* special start */ $input = 0; /* special end */ %}
#ifdef SWIGPHP
%typemap(directorout, warning="PHP directorout typemaps need fixing") MyType &Class1::foo2, MyType &foo1 %{ /* special start */ /*$input = 0;*/ /* special end */ %}
/* Patch to make $input work same as other languages. Then $input needs changing to &$input in most (maybe all) typemaps.
--- a/Source/Modules/php.cxx
+++ b/Source/Modules/php.cxx
@@ -2631,8 +2631,7 @@ done:
if (!is_void) {
tm = Swig_typemap_lookup("directorout", n, Swig_cresult_name(), w);
if (tm != 0) {
- static const String *amp_result = NewStringf("&%s", Swig_cresult_name());
- Replaceall(tm, "$input", amp_result);
+ Replaceall(tm, "$input", Swig_cresult_name());
char temp[24];
sprintf(temp, "%d", idx);
Replaceall(tm, "$argnum", temp);
*/
#endif
#ifdef SWIGCSHARP
%typemap(csdirectorout) MyType & %{ WILL_NOT_COMPILE %}