Commit graph

313 commits

Author SHA1 Message Date
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
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
William S Fulton
25ff4e4927 merge revisions 11877-12162 from trunk to gsoc2009-matevz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12164 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-07-20 23:35:40 +00:00
William S Fulton
ab1cd03979 merge revisions 11243-11872 from trunk to gsoc2009-matevz
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12162 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-07-20 21:58:41 +00:00
William S Fulton
d8cc75946b Improved C++0x rvalue reference implementation differentiating lvalue and rvalue references. The previous implementation treated rvalue references as lvalue references which leads to a number of different wrapping issues.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-matevz@12160 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-07-18 00:19:22 +00:00