Revert this fix unless ZEND_RAW_FENTRY is defined (it was added in

PHP 5.2.<something>):

    [PHP] Fix many occurrences of "warning: deprecated conversion from
    string constant to 'char*'" from GCC 4.2 in generated C/C++ code.

Use zend_function_entry rather than function_entry in generated code.
The later only exists for compatibility with PHP3!


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9997 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2007-10-17 17:25:15 +00:00
commit a1ae35b43f
2 changed files with 13 additions and 3 deletions

View file

@ -14,6 +14,16 @@ extern "C" {
#include "zend_API.h"
#include "php.h"
#ifdef ZEND_RAW_FENTRY
/* ZEND_RAW_FENTRY was added somewhere between 5.2.0 and 5.2.3 */
# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_RAW_FENTRY((char*)#ZN, N, A, 0)
#else
/* This causes warnings from GCC >= 4.2 (assigning a string literal to char*).
* But this seems to be unavoidable without directly assuming knowledge of
* the structure, which changed between PHP4 and PHP5. */
# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A)
#endif
/* These TSRMLS_ stuff should already be defined now, but with older php under
redhat are not... */
#ifndef TSRMLS_D