|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56805 "long long" bug
Submitted: 2006-01-27 04:59 UTC Modified: 2013-02-18 00:35 UTC
From: tanguy dot pruvot at gmail dot com Assigned:
Status: No Feedback Package: ffi (PECL)
PHP Version: 5_1 CVS-2006-01-27 OS: Win32 / Unix
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-01-27 04:59 UTC] tanguy dot pruvot at gmail dot com
Compilation with PHP 5.1.x fails..

i tried to fix it in ffi.h from libffi with :

 #ifdef PHP_WIN32
 # define UINT64  LONG64
 # define SINT64  INT64
 # define UINT64  unsigned long long
 # define SINT64  long long

compilation works but php crashes when we call a ffi object method

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
..\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



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-27 14:12 UTC] tanguy dot pruvot at gmail dot com
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) {
		for (i = 0; i < nargs; i++) {
			if (need_free[i]) {
		if (values) {
		if (return_value_buf) {
		if (need_free) {
	zend_catch {} 
 [2006-02-01 07:46 UTC]
Please send a unified diff against CVS
 [2010-05-20 13:14 UTC] tanguy dot pruvot at gmail dot com
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,
+	zval *object,
+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;
 	obj = CTX_FETCH(object);
 	func = bind_func(obj, name, len TSRMLS_CC);
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 07:03:34 2021 UTC