|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-27 04:59 UTC] tanguy dot pruvot at gmail dot com
Description: ------------ Compilation with PHP 5.1.x fails.. i tried to fix it in ffi.h from libffi with : #elif SIZEOF_LONG_LONG == 8 #ifdef PHP_WIN32 # define UINT64 LONG64 # define SINT64 INT64 #elif # define UINT64 unsigned long long # define SINT64 long long #endif #endif compilation works but php crashes when we call a ffi object method http://pecl4win.php.net/download.php/blog/5_1/compilelog.txt Trying php_ffi.dll... FAILED "cl.exe" /D COMPILE_DL_FFI /D FFI_EXPORTS=1 /D PHP_LIBFFI_VERSION="2.00-beta" /I"..\pecl_5_0\ffi/libffi/include" /nologo /FD /I . /I main /I regex /I Zend /I TSRM /I ext /D _WINDOWS /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /YX /Zi /LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /D ZTS=1 /I "..\php_build\include" /D FD_SETSIZE=256 /FoRelease_TS\pecl_5_0\ffi\ /FdRelease_TS\pecl_5_0\ffi\ /FpRelease_TS\pecl_5_0\ffi\ /FRRelease_TS\pecl_5_0\ffi\ /c ..\pecl_5_0\ffi\ffi_int64.c ..\pecl_5_0\ffi\ffi_library.c ..\pecl_5_0\ffi\ffi_parser.c ..\pecl_5_0\ffi\ffi_parser_util.c ..\pecl_5_0\ffi\ffi_struct.c ..\pecl_5_0\ffi\php_ffi.c ffi_int64.c ..\pecl_5_0\ffi\php_ffi_internal.h(25) : warning C4005: 'SINT64' : macro redefinition ..\pecl_5_0\ffi/libffi/include\ffi.h(112) : see previous definition of 'SINT64' ..\pecl_5_0\ffi\ffi_int64.c(34) : error C2632: 'long' followed by 'long' is illegal ..\pecl_5_0\ffi\ffi_int64.c(36) : error C2632: 'long' followed by 'long' is illegal ... PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
the fatal error is in ffi_library.c, in php_ffi_call_method function : Fixed with try catch at Line 508 : zend_try { if (args) { efree(args); } for (i = 0; i < nargs; i++) { if (need_free[i]) { efree(values[i]); } } if (values) { efree(values); } if (return_value_buf) { efree(return_value_buf); } if (need_free) { efree(need_free); } } zend_catch {} zend_end_try();Here is the bug fix for Win32/64 Index: ffi_library.c ============================================================ ======= --- ffi_library.c (r?vision 299526) +++ ffi_library.c (copie de travail) @@ -395,12 +395,22 @@ return func; } -static union _zend_function *php_ffi_method_get(zval *object, char *name, int len TSRMLS_DC) +static union _zend_function *php_ffi_method_get( +#if PHP_API_VERSION >= 20041225 + zval **object_pp, +#else + zval *object, +#endif +char *name, int len TSRMLS_DC) { zend_internal_function *f; php_ffi_context *obj; php_ffi_function *func; - + +#if PHP_API_VERSION >= 20041225 + zval *object = *object_pp; +#endif + obj = CTX_FETCH(object); func = bind_func(obj, name, len TSRMLS_CC);