From 3d6dcc3ce61afbe43a9dce61c26eed144c3c239f Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 3 Jul 2008 22:00:01 +0000 Subject: [PATCH] The operator& trick in allowexcept.i doesn't work for SWIG/PHP because the generated code takes the address of the variable in the code in the "vinit" section. So comment out the private operator& for PHP. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10643 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/allowexcept.i | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/allowexcept.i b/Examples/test-suite/allowexcept.i index 14b19b33d..37b01cd75 100644 --- a/Examples/test-suite/allowexcept.i +++ b/Examples/test-suite/allowexcept.i @@ -26,14 +26,26 @@ UVW Bar::static_member_variable; struct XYZ { }; +// The operator& trick doesn't work for SWIG/PHP because the generated code +// takes the address of the variable in the code in the "vinit" section. +#ifdef SWIGPHP %{ struct XYZ { void foo() {} private: XYZ& operator=(const XYZ& other); // prevent assignment used in normally generated set method - XYZ* operator&(); // prevent dereferencing used in normally generated get method }; %} +#else +%{ +struct XYZ { + void foo() {} +private: + XYZ& operator=(const XYZ& other); // prevent assignment used in normally generated set method + XYZ* operator&(); // prevent dereferencing used in normally generated get method +}; +%} +#endif #if defined(SWIGUTL) %exception { /*