Commit graph

123 commits

Author SHA1 Message Date
Olly Betts
ea5be4e508 Fix PHP backend for default_args testcase 2015-01-14 10:44:54 +13:00
Olly Betts
682b4dd843 [PHP] Fix segfault in director upcall check
Manifest only when using PHP built with ZTS enabled.
2015-01-12 13:53:01 +13:00
William S Fulton
06e361dbf2 Fix linux gcc warnings and strtol corrections 2015-01-11 17:30:25 +00:00
Olly Betts
cd16059c66 Provide -cppext as a general command line option
Provide -cppext as a general command line option for setting the
extension used for generated C++ files (previously it was specific
to the PHP backend).  Deprecate the equivalent -suffix option
provided by the Ocaml backend, but continue to support that for
now.
2015-01-08 10:54:37 +13:00
Olly Betts
1a99212c2c [PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
2014-09-12 12:48:37 -03:00
Olly Betts
14c2cf3407 PHP: Fix memory leak if a director method is passed Null for self 2014-08-29 16:28:00 -03:00
Olly Betts
73bb909bae [PHP] The generated __isset() method now returns true for read-only properties. 2014-05-01 14:37:58 +12:00
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
Olly Betts
f563069e7b [PHP] Fix wrapping director constructors with default parameters with a ZTS-enabled build of PHP. 2014-04-03 10:38:19 +13:00
Olly Betts
2a3981289d [PHP] Pass the ZTS context we already have to avoid needing to
call TSRMLS_FETCH, which is relatively expensive.
2014-04-02 23:35:59 +13:00
Miklos Vajna
227192f80a Fix Examples/php/pointer to work with PHP 5.5
With this, all examples work with PHP 5.5 for me.
2013-12-12 15:52:51 +13: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
d15220cba4 Remove a couple of unused variable warnings in generated code 2013-10-18 19:10:42 +01: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
William S Fulton
c4d40c7b64 PHP directors - generate call_user_function on one line 2013-10-01 22:13:57 +01:00
Olly Betts
24ff00690f Use ZVAL_STRINGL instead of ZVAL_STRING to set funcname as we know the length at swig-time 2013-04-14 08:03:46 +12:00
Olly Betts
a16dc29046 Removed unused Printf parameter 2013-04-14 06:14:47 +12:00
Sylvestre Ledru
e0b14786d6 Fix some useless code detected by scan-build (LLVM/Clang) 2013-03-08 20:53:18 +00: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
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
Olly Betts
0dd11cdd8d Fix to work with a ZTS build of PHP (broken in 2.0.7) 2013-01-08 18:33:47 +13:00
William S Fulton
8a8c8e377b gcc-4.6 warning fix
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13972 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-15 18:33:02 +00:00
William S Fulton
89052f3b0a Fix Strcmp - it didn't have consistent null pointer handling - revert to what it used to be - a lightweight wrapper around strcmp which means functions once again must not pass in null to it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13943 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-02 13:36:13 +00:00
William S Fulton
d93dc0f8e2 Distinguish between an "abstract" attribute on a class containing a list of abstract members and an "abstract" flag on pure virtual methods - renamed former to "abstracts"
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-24 14:13:58 +00:00
William S Fulton
0d2c459046 Remove some unused code and pointless variable assignments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13932 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-23 07:38:00 +00:00
William S Fulton
d918bddfc0 Fix segfaults when using filename paths greater than 1024 characters in length - use String * and heap instead of fixed size static char array buffers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-18 00:45:18 +00:00
William S Fulton
46d2486115 Resource leak fixes (or hiding them from Coverity static analysis tool by using String instead of char *)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13886 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:54 +00:00
William S Fulton
5a1e82a2f4 Remove DohClose (Close) and replace with calls to DohDelete (Delete) to fix some minor memory leaks in most uses of NewFile.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13885 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:07 +00:00
William S Fulton
b1ee062d2a Cosmetic variable renaming for consistency across language modules
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:38:05 +00:00
William S Fulton
f6229d4b73 Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously the name was ignored during the typemap search. Implemented by ensuring the 'type' attribute in the Node is set up correctly and using the usual Swig_typemap_lookup on the Node.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13873 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:37:34 +00:00
William S Fulton
ecac2d2a68 Improve nullptr constant wrapping
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@13842 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-20 19:09:38 +00:00
Olly Betts
7196e556a5 Fix SF#3528035, a regression introduced by the fix for SF#3428833.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13105 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-23 02:58:24 +00:00
Olly Betts
de9d01dbcd [PHP] Fix getters for template members. (SF#3428833)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13096 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-18 02:43:52 +00:00
Olly Betts
a2a42c7038 Add back 'NIL', dropped by mistake in change before last.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13082 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 05:11:02 +00:00
Olly Betts
e4763231be Remove some commented out code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13081 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 04:58:08 +00:00
Olly Betts
4f11fd51ab Drop check for "ZEND_MODULE_API_NO > 20010900". We only support PHP5
now, and 5.0.0 was released in 2004.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13080 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-14 03:31:04 +00:00
Olly Betts
d81770dd93 [PHP] Fix memory leak in code generated for a callback. Patch from
SF bug #3510806.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13079 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-12 13:52:00 +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
William S Fulton
468ca084fc Correct special variables in 'directorargout' typemap. This change will break any 'directorargout' typemaps you may have written. Please change: to and to \n Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't previously compile and add in , etc expansion.\n [C#, Go, Java, D] Add support for the 'directorargout' typemap.\n [Java] Add (char *STRING, size_t LENGTH) director typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-20 20:50:36 +00:00
William S Fulton
24133bacd7 Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-30 21:51:50 +00:00
William S Fulton
44c202d048 Add in $symname expansion for director methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12772 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-04 19:45:19 +00:00
Olly Betts
210266cd70 [PHP] Don't generate "return $r;" in cases where $r hasn't been set.
This was basically harmless, except it generated a PHP E_NOTICE if
the calling code had enabled them.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12767 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-07-29 10:51:02 +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
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
dce3b5bacf [PHP] Fix handling of directors when -prefix is used.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12722 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-30 04:49:29 +00:00
Olly Betts
1d7f309a8a [PHP] Fix handling of methods of classes with a virtual base class (SF#3124665).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12711 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-24 14:51:59 +00:00
Olly Betts
72fc8be46c [PHP] Fix handling of overloaded methods/functions where some
return void and others don't - whether this worked or not depended 
on the order they were encountered in (SF#3208299).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12539 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 12:33:56 +00:00
William S Fulton
a63d456f8a Remove redundant code highlighted by warnings in gcc-4.6
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 07:22:08 +00:00
William S Fulton
b69b793d8e Better consistency in usage display
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-09 21:42:38 +00:00
Olly Betts
24053d7789 [PHP] Don't use zend_error_noreturn() for cases where the function
returns void - now this issue can only matter if you have a function
or method which is directed and returns non-void.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12523 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-07 23:05:01 +00:00