Commit graph

72 commits

Author SHA1 Message Date
Olly Betts
abfa75b169 [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
if the type lookup fails.
2013-06-04 12:53:27 +12: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
2c74c90430 Fix for gcc warning -Wunused-value without triggering -Wunused-parameter
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13735 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-07 06:06:00 +00:00
William S Fulton
12a9671440 std::string typemap modifications so they can be used with %apply for other string classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-26 06:33:49 +00:00
William S Fulton
142f1e72bb Fix some language's std::map wrappers to recognise difference_type, size_type, key_type and mapped_type.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13092 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-15 19:51:06 +00:00
Olly Betts
d96db667f7 [PHP] Avoid using zend_error_noreturn() as it doesn't work with all
builds of PHP (SF bug #3166423).  Instead we now wrap it in a
SWIG_FAIL() function which we annotate as "noreturn" for GCC to
avoids warnings.  This also reduces the size of the compiled
wrapper (e.g. the stripped size is 6% for Xapian's PHP bindings).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13077 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-12 13:26:16 +00:00
Olly Betts
fcb46fe2fa [PHP] Fix the constant typemaps for SWIGTYPE, etc - previously
these used the wrong name for renamed constants.  Add
autodoc_runme.php to the testsuite as a regression test for this.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13062 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-10 11:41:19 +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
ee474ece0e Update keyword list to include keywords add in PHP releases up to 5.3.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12845 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-11-28 04:07:44 +00:00
Olly Betts
688ea24560 [PHP] Fix director code to work when PHP is built with ZTS enabled,
which is the standard configuration on Microsoft Windows.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12749 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-06-23 16:04:42 +00:00
Olly Betts
a09225e70b Need to cast away const-ness for the PHP API.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12724 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 06:58:26 +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
4c64a731c8 Avoid pointless creation of a PHP string
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 04:37:49 +00:00
Olly Betts
f38530b490 Make a char * pointer we don't modify through const.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12710 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-24 03:59:35 +00:00
Olly Betts
669bc0e001 [PHP] Fix sharing of type information between multiple SWIG-wrapped modules (SF#3202463).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12528 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-12 01:38:27 +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
28deca09be [PHP] Add missing INPUT, OUTPUT and INOUT typemaps in the typemaps.i library for primitive reference types as well as signed char * and bool *.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12480 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-19 14:53:53 +00:00
Olly Betts
3cee7b7b3e [PHP] Fix invalid erase during iteration of std::map in generated
director code.  Reported by Cory Bennett in SF#3175820.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-18 05:30:26 +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
c7a6e3dad4 Fix // comments to /* */ in typemaps which should be usable from C code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12109 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 02:34:25 +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
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
Olly Betts
ed98187e3b Tidy up typemaps, combining variants with the same code.
Use const_cast to remove const-ness from const char * for stupid PHP API in
%throws typemap.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12054 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-26 00:19:08 +00:00
Olly Betts
9207a2fe37 [PHP] Add missing directorin typemap for const std::string &.
Fixes SF#3006404 reported by t-Legiaw.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12053 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-25 23:38:44 +00:00
Olly Betts
08cdb5a7ee Set string contents when we allocate it for a small efficiency gain.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12052 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-05-25 21:46:23 +00:00
William S Fulton
964382336e remove std::map specializations - not needed since the typemap matching rules were changed to follow type deducation used in template specialization
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11978 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-04-04 20:37: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
b2fc62f21f [PHP] Add datetime to the list of PHP predefined classes (patch from David
Fletcher in SF#2931042).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11822 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-13 11:53:18 +00:00
Olly Betts
0633acd24f [PHP] "empty" is a reserved word in PHP, so rename empty() method
on STL classes to "is_empty()" (previously this was automatically
renamed to "c_empty()").
*** POTENTIAL INCOMPATIBILITY ***


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-04 04:33:58 +00:00
Olly Betts
7ba280b4b8 Fix warnings for passing string constant for char * (the PHP API isn't const
correct).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11769 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-03 13:58:44 +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
Olly Betts
2c74fbf9e4 [PHP] Fix warning and rename of reserved class name to be case insensitive.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11763 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-12-02 13:02:38 +00:00
William S Fulton
3932d02a2a fix SWIG naming convention
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11663 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-21 00:25:11 +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
Miklos Vajna
6f80e2f7a6 PHP: Add directorout typemap for primitive type const refs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11559 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 04:22:03 +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
Olly Betts
3675a7baf7 Add min and max as built-in functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11555 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-14 01:00:36 +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
d2316a8189 PHP std::vector wrappers overhaul modelling on Java std_vector.i. Work around empty rename warning problem. Add capacity and reserve(). Remove need for specialize_std_vector macro.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11550 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-13 22:07:34 +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