Commit graph

69 commits

Author SHA1 Message Date
Olly Betts
630e438c6a [PHP] Address bug in PHP on some platforms/architectures which
results in zend_error_noreturn() not being available using
SWIG_ZEND_ERROR_NORETURN which defaults to zend_error_noreturn but
can be overridden when building the module by passing
-DSWIG_ZEND_ERROR_NORETURN=zend_error to the compiler.  This may
result in compiler warnings, but should at least allow a module
to be built on those platforms/architectures (SF#3166423).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-19 13:28:43 +00:00
Olly Betts
bf7c9e9a42 [PHP] An overloaded method which can return an object or a
primitive type no longer causes SWIG to segfault.  Reported by Paul
Colby in SF#3168531.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12471 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-18 06:39:51 +00:00
William S Fulton
74883f1dd7 [PHP] SF #3166423 Recent PHP versions no longer define zend_error_noreturn - calls to this have been replaced with zend_error.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12430 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-04 20:25:59 +00:00
William S Fulton
1adc50e730 constify SwigType * in many places
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12349 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-15 21:55:08 +00:00
William S Fulton
004643ff30 Fix mangling of PHP constructor wrapper when types use global scope or typedefs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12309 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-25 20:39:11 +00:00
Olly Betts
9eaf5ba1be [PHP] Allow compilation on non-conforming Microsoft C++ compilers
which don't accept: return function_returning_void();
Reported by Frank Vanden Berghen on the SWIG mailing list.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12265 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-10-14 05:13:09 +00:00
Olly Betts
a25ccbf58b [PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12208 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-09-08 02:40:56 +00:00
Olly Betts
d0d40db326 Use SWIG_PTR rather than literal "_cPtr".
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12149 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-25 02:41:27 +00:00
Olly Betts
ae40eff993 The default visibility for methods is public, so don't specify that explicitly
to keep the wrapper size down.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12146 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 14:44:06 +00:00
William S Fulton
95a3eb5a7d code style: fix inconsistent NULL pointer comparisons
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12137 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-17 23:49:12 +00:00
Olly Betts
f67c0fa12c [PHP] Fix directors to correctly call a method with has a
different name in PHP to C++ (we were always using the C++ name
in this case).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12110 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 04:41:11 +00:00
William S Fulton
bb41eeb343 Fix potential name clashes with symbols in the Director class
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12062 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-27 20:55:24 +00:00
Olly Betts
e512093358 [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
2010-05-21 07:07:15 +00:00
Olly Betts
227f2e2e0a [PHP] Fix wrapping of global variables which was producing
uncompilable code in some cases.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12027 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-14 08:22:28 +00:00
William S Fulton
e81bfb86c0 Correct file and line number display for some error messages, these now also result in exiting with an error.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-03-13 23:08:02 +00:00
William S Fulton
cb64f65bae SWIG license change - Source moves to GPLv3
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:53:33 +00:00
William S Fulton
83bd820285 Add typemaps used debugging option (-debug-tmused). Fix missing file/line numbers for typemap warnings and in the output from the -debug-tmsearch/-debug-tmused options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11802 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-04 19:33:52 +00:00
Olly Betts
bfb09161f7 Eliminate "int error;" declaration from generated PHP director support code
if it isn't used.  No change in behaviour, and the compiler will just optimise
away the unused variable, but it can cause an "unused variable" warning.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11776 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-10 11:52:29 +00:00
Olly Betts
bcda9644f1 Remove two commented out lines of code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11773 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 04:56:10 +00:00
Olly Betts
dd5714ea28 [php] Fix place where class prefix (as specified with -prefix)
wasn't being used.  Patch from gverbruggen in SF#2892647.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11736 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-11-13 07:15:08 +00:00
Miklos Vajna
fc52ca3b80 PHP: handle -prefix when checking if a class has been subclassed or not
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11637 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-18 16:23:23 +00:00
Olly Betts
4540717c39 [PHP] Fix to wrap a resource returned by __get() in a PHP object (SF#2549217).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11619 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-17 08:47:30 +00:00
Olly Betts
47e404ba5b Only have an array for properties in the base class, not in derived classes.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11611 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-17 05:24:17 +00:00
Olly Betts
c4f5f22f67 Remove some superfluous "else"s in generated PHP code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11610 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-17 03:19:14 +00:00
Miklos Vajna
8da18d336e PHP: Optimize the previous commit a bit.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11594 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-16 21:47:24 +00:00
Miklos Vajna
b5c49c20fd PHP: fix for the valuewrapper_base testcase
The problem is the following: before director support, the return class
type of a function was hardwired. That was bad, as factory functions
wanted to instantiate abstract classes, so we switched to detecting the
class type based on the PHP resource type. That was good, but broke the
case when for example

%template(make_Interface_BP) make<Interface_<BinaryPolarization> >;

was used, as the cheap parser had no idea how to turn
'Interface_T_oss__BinaryPolarization_t' to 'make_Interface_BP'.

This patch still uses the resource type detection, but in case that
would result in a non-existing class, we just use the hardwired name.

NOTE: This still does not fix the case when abstract classes are used
with templates.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11593 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-16 21:44:05 +00:00
Olly Betts
f3d0ebbf18 Refactor the recent support for wrapping static member variables for PHP5 so it
works for static members which are themselves classes.  With this and the previous
patch, li_std_string now passes and all other tests pass/fail as before.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11578 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-15 05:33:05 +00:00
Olly Betts
ba29cea2b5 Minor cleanups.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11571 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 17:01:20 +00:00
Olly Betts
57017bd6bc [PHP] PHP5 now wraps static member variables as documented.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11570 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 16:22:15 +00:00
Olly Betts
f4e3444ae3 Use module name instead of hardcoded "example" in __get().
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11567 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 09:44:15 +00:00
Olly Betts
e125ce326d If $c would be used as a parameter name, rename it to $c_ to avoid issues
if call-time pass-by-reference is enabled and used.
Use $c instead of $class to keep down the number of "reserved" parameter
names.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11564 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 08:04:21 +00:00
Olly Betts
e068305125 If there's no prefix, special case to avoid prepending an empty string.
Don't calculate $class in the stdClass case when we don't need it.
Eliminate an unnecessary else.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11563 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 07:53:38 +00:00
Miklos Vajna
889b156afd PHP: fix for the extend_template testcase
The fix is not to handle a %template as a rename by reading the class'
sym:name attribute instead of the ctor's name attribute.

This has been broken in r11510.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11539 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-12 11:18:58 +00:00
Olly Betts
741b90763b Fix to work for classes which aren't called "Foo"...
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11531 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-11 14:42:03 +00:00
Olly Betts
37b9370344 Eliminate space before "function" when there's no access specifier (just a
cosmetic tweak).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-11 14:40:51 +00:00
Miklos Vajna
b61f9da6e6 PHP: fix for the template_ref_type testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11528 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-11 10:19:04 +00:00
Miklos Vajna
486419b271 PHP: Skip the Foo:: prefix when detecting ctor renames
This fixes a few testcases (like the mixed_types one) I broke in the
previous commit.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11512 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-06 13:16:50 +00:00
Miklos Vajna
09b20003fb PHP: fix for the overload_rename testcase
Previously we just had two __construct function which resulted in a
parse error. Now we create a new factory method for the renamed ctor.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11510 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-06 12:27:03 +00:00
Miklos Vajna
76a90e6606 PHP: define our own ZEND_MODULE_BUILD_ID macro for PHP <= 5.3
This silences the warning, but causes no breakage for future releases.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11504 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-05 11:37:45 +00:00
Miklos Vajna
9444f2cebe PHP: fix for the import_nomodule testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11490 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-03 13:52:25 +00:00
Miklos Vajna
ad0428538d PHP: fix for the cpp_namespace testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11480 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 14:01:27 +00:00
Miklos Vajna
7e4b1a086d PHP: Cleanups.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11479 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 12:16:50 +00:00
Olly Betts
19c4162047 Remove dead code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11477 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 08:50:56 +00:00
Olly Betts
7c84046a36 Make SwigPHP_emit_resource_registrations() static.
Remove "NEW Destructor style" comment as it's no longer meaningful.
Undo indent damage.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11476 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 08:39:27 +00:00
William S Fulton
028fcff0a5 remove redundant method
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11474 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 06:08:36 +00:00
William S Fulton
7f0e632ddd typemap method name: use consistent terminology in code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11473 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-30 06:06:49 +00:00
Miklos Vajna
ae606df4df PHP: fix for the allowexcept testcase
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-29 16:17:04 +00:00
Miklos Vajna
22351914fe PHP: Avoid calling is_resource() twice with no good reason
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11466 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-29 11:03:22 +00:00
Olly Betts
4b7478ac15 [PHP] Fix memory leak in PHP resource destructor for classes
without a destructor and non-class types.  Patch from Hitoshi Amano
in SF#2825303.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11463 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-29 02:06:18 +00:00
Olly Betts
c321421bc5 [PHP] Update warnings about clashes between identifiers and PHP
keywords and automatic renaming to work with the PHP5 class 
wrappers.  Fixes SF#1613679.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11460 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-28 13:12:06 +00:00