Commit graph

43 commits

Author SHA1 Message Date
Olly Betts
3499675cb0 Fix hardcoded _v in PHP typecheck typemaps
This should be $1, which ends up substituted with _v so this does
not actually affect behaviour.
2019-02-12 09:29:41 +13:00
Olly Betts
60eccff4b7 [php] Fix typemap indentation (cosmetic) 2019-02-11 10:49:20 +13:00
William S Fulton
b7db45661a Fix overloading for non-pointers and NULL - Php 2018-12-30 12:00:49 +00:00
Olly Betts
74a4cc8786 [php] Fix reported descriptor in typemap error message
The affected typemap is %typemap(in) SWIGTYPE *DISOWN, where the
error message was referring to $&1_descriptor but the descriptor
actually used by the typemap is $1_descriptor.
2017-08-09 11:37:03 +12:00
William S Fulton
72ba741d1c Fix wrapping of references/pointers and qualifiers to member pointers
Also fix Go wrapping of member const function pointers.
2017-03-16 21:04:38 +00:00
Olly Betts
1169874f59 [PHP] Add support for PHP7.
PHP5's C extension API has changed substantially so you need to use
-php7 to specify you want PHP7 compatible wrappers.
Fixes https://github.com/swig/swig/issues/571
2016-11-30 13:05:59 +13:00
Olly Betts
a4015acaca [PHP] Fix out typemap for member function pointers
The existing typemap was just broken - it correctly created the resource
and then did nothing with it, and instead tried to register the member
pointer as a normal pointer, which is never going to work as it's larger
than a normal pointer.

Add cpp_basic_runme.php as a regression test for this.
2016-09-02 09:51:18 +12:00
William S Fulton
98a31ff633 Fix directorin SWIGTYPE typemaps to make a copy as these are used for pass by value.
Closes #434
2016-05-14 21:32:24 +01:00
William S Fulton
4b23f5d9d4 Consistent memory initialization in php typemaps.
Memory was only initialized in C and not C++ - potential bug?
2015-07-30 20:41:20 +01:00
Olly Betts
e12322df86 [PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).
2014-09-11 13:09:08 -03:00
Olly Betts
cecd89f66f [PHP] The usage of $input in PHP directorout typemaps has been
changed to be consistent with other languages.  The typemaps
provided by SWIG have been updated accordingly, but if you
have written your own directorout typemaps, you'll need to
update $input to &$input (or make equivalent changes).

*** POTENTIAL INCOMPATIBILITY  ***
2013-12-12 15:40:15 +13:00
William S Fulton
bcb7aee022 Merge branch 'master' into gsoc2009-matevz
Conflicts:
	Examples/Makefile.in
	Examples/guile/Makefile.in
	Lib/php/php.swg
	Makefile.in
	Source/CParse/parser.y
	configure.ac
2013-10-10 07:26:09 +01:00
Olly Betts
939fa86627 [PHP] Add missing directorin typemap for char* and char[] which
fixes director_string testcase failure.
2013-04-09 14:35:14 +12:00
William S Fulton
e805d5f925 Merge branch 'master' into gsoc2009-matevz
parser.y still to be fixed up

Conflicts:
	Doc/Devel/engineering.html
	Examples/Makefile.in
	Lib/allegrocl/allegrocl.swg
	Lib/csharp/csharp.swg
	Lib/csharp/enums.swg
	Lib/csharp/enumsimple.swg
	Lib/csharp/enumtypesafe.swg
	Lib/java/java.swg
	Lib/python/pydocs.swg
	Lib/r/rtype.swg
	Source/Include/swigwarn.h
	Source/Modules/octave.cxx
	Source/Modules/python.cxx
	Source/Modules/ruby.cxx
	Source/Swig/scanner.c
	Source/Swig/stype.c
	Source/Swig/swig.h
	configure.ac
2013-01-28 07:01:37 +00:00
William S Fulton
d3769a1fd4 Add rvalue reference typemaps 2013-01-24 20:27:28 +00:00
William S Fulton
38f6156a93 Using C++11 enum classes with just a forward reference.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13013 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-23 22:15:37 +00:00
William S Fulton
4c898b023c The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12879 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-21 07:16:44 +00:00
Olly Betts
29190559f8 SWIG_ZTS_SetPointerZval() now interprets bit 1 in newobject as meaning (wrap
in a PHP class wrapper), rather than taking newobject==2 as meaning this,
so we can wrap new and existing objects in this way.

Handle wrapping classes in a C++ namespace being returned by director methods.

No need to force classname to lowercase as zend_lookup_class() does that
internally.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12723 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 06:47:47 +00:00
Olly Betts
4fbb9e24d6 [PHP] Add casts to the typemaps for long long and unsigned long
long to avoid issues when they are used with shorter types via
%apply.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12520 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-07 04:06:54 +00:00
William S Fulton
5f8c936569 Fix some eroneous typecheck rankings for php
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12439 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-05 22:58:32 +00:00
William S Fulton
640cce2c50 Fix typecheck typemaps for SWIGTYPE *const&
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12413 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-30 00:42:27 +00:00
William S Fulton
ef865e06d5 Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and (char *STRING, int LENGTH) - Java patch is from Volker Grabsch. Elements of the primitive_types.i testcase for this moved into char_binary.i. Documentation for this enhanced.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12393 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-14 19:06:43 +00:00
Olly Betts
b36ae8aaf4 Attach the swig_php_init_member_ptr fragment to all the typemaps which need it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12148 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-25 01:48:33 +00:00
William S Fulton
b946430c8a Remove potential symbol clash with wrapped code (php)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12147 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 19:33:21 +00:00
Olly Betts
0d7863c810 Wrapping pointer to member function types is likely to be rare, so use
%fragment to only pull in the required machinery if it is going to be
used.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12145 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-24 14:16:16 +00:00
Olly Betts
1392a6e497 [PHP] When using %throws or %catches, SWIG-generated PHP5 wrappers
now throw PHP Exception objects instead of giving a PHP error of
type E_ERROR.

This change shouldn't cause incompatibility issues, since you can't
set an error handler for E_ERROR, so previously PHP would just exit
which also happens for unhandled exceptions.  The benefit is you can
now catch them if you want to.

Fixes SF#2545578 and SF#2955522.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12055 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-26 07:32:20 +00:00
William S Fulton
bdb136d611 Change typemap matching rules for the default type (SWIGTYPE) to follow template partial specialization type deduction. Fixes some containers of const pointers. SWIGTYPE*& typemps removed and replaced with SWIGTYPE *const&.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-01 18:26:37 +00:00
William S Fulton
4308dd03cf SWIG license change - The Examples and Lib move to a very permissive license in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:26:02 +00:00
Olly Betts
67bbac4872 Add PHP typemaps for pointer to method.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11768 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 12:59:59 +00:00
Olly Betts
d277354167 Add long long and unsigned long long const reference typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11767 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 05:21:48 +00:00
Olly Betts
d6984c5253 [PHP] Add typemaps for long long and unsigned long long.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11766 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 04:48:54 +00:00
Olly Betts
52bdfa3097 Add input typemaps for long long and unsigned long long for PHP.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11765 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 01:29:45 +00:00
William S Fulton
06c06f8742 remove redundant if not __cplusplus for directorin typemap - directors are always c++
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11575 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 22:47:11 +00:00
William S Fulton
45359dc12c Add SWIGTYPE *& typemaps for PHP
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11556 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 01:14:49 +00:00
William S Fulton
cc43f20f6d PHP fix const char\*\& typemaps and add in char_strings runtime test based on Java version
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11552 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 23:31:19 +00:00
William S Fulton
42d7f3bb10 add php typecheck typemaps for const reference for primitives
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11551 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 22:39:20 +00:00
William S Fulton
627d9faffd Add PHP const ref typemaps for primitive types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11549 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 21:41:23 +00:00
Miklos Vajna
0249eea389 Merge https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-vmiklos/
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11434 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-07-22 11:08:29 +00:00
Olly Betts
64843143f1 The default out typemap for char[ANY] now returns up to a zero byte, or the end
of the array if there is no zero byte.  This is the same as Python does, and seems
more generally useful than the previous behaviour of returning the whole
contents of the array including any zero bytes.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11176 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-03-30 02:22:14 +00:00
Olly Betts
fccd1e294a Fix indentation. Use %{ %} in a couple of typemaps to avoid adding needless
{ } to the generated code.  Use memcpy() instead of memmove() where the
destination is freshly allocated so there's no possibility of overlap.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-10-01 11:54:31 +00:00
Olly Betts
7ef2b73a6d [PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10881 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-09-25 07:11:36 +00:00
Olly Betts
1e6d6b2708 [PHP] The SWIG cdata.i library module is now supported.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10647 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-07-03 23:55:33 +00:00
Olly Betts
3d3bc01a2f Rename php4*.swg to php*.swg.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10635 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-07-03 00:37:38 +00:00
Renamed from Lib/php/php4.swg (Browse further)