From: Thomas Deniau <thomas@de...> - 2006-02-16 17:37:14
When one has a ZTS-enabled PHP (Zend Thread Safety) (this is a common case on
Windows, where all the prebuilt PHP binaries have ZTS on), some zend_ functions
take extra arguments (they are probably needed for thread safety). As a result,
the code that SWIG generates can't be compiled.
For example, the examples shipped with Swig fail to compile :
bash-3.00$ php -version
PHP 5.1.2 (cli) (built: Jan 11 2006 16:40:00)
bash-3.00$ grep "define ZTS" /usr/local/include/php/main/php_config.h
#define ZTS 1
bash-3.00$ swig -version
SWIG Version 1.3.28
gcc `php-config --includes` -fpic -c example_wrap.c
example_wrap.c: In function `SWIG_Php4_GetModule':
example_wrap.c:852: error: too few arguments to function `zend_get_constant'
[and lots of other errors]
This bug was originally reported at
but that ticket was wrongly closed (it's reportedly fixed in 1.3.27 and I'm
using 1.3.28) and I do not have the privileges required to re-open it.