[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] =?utf-8?q?svn:_/pecl/scream/trunk/_scream.c?=
From:       Johannes_Schlüter <johannes () php ! net>
Date:       2013-07-19 20:53:54
Message-ID: svn-johannes-1374267234-330982-1937764377 () svn ! php ! net
[Download RAW message or body]

johannes                                 Fri, 19 Jul 2013 20:53:54 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=330982

Log:
PHP 5.5 compatibility

Changed paths:
    U   pecl/scream/trunk/scream.c

Modified: pecl/scream/trunk/scream.c
===================================================================
--- pecl/scream/trunk/scream.c	2013-07-19 19:26:40 UTC (rev 330981)
+++ pecl/scream/trunk/scream.c	2013-07-19 20:53:54 UTC (rev 330982)
@@ -57,11 +57,25 @@
 /* {{{ zend hooks */

 /* Pointer to the original execute function */
+#if PHP_VERSION_ID < 50500
+#define ZEND_EXECUTE_FUNC zend_execute
 static ZEND_DLEXPORT void (*_zend_execute) (zend_op_array *ops TSRMLS_DC) = NULL;
+#else
+#define ZEND_EXECUTE_FUNC zend_execute_ex
+static ZEND_DLEXPORT void (*_zend_execute)(zend_execute_data *execute_data \
TSRMLS_DC) = NULL; +#endif

 /* Pointer to the original execute_internal function */
-static ZEND_DLEXPORT void (*_zend_execute_internal) (zend_execute_data *data, int \
ret TSRMLS_DC) = NULL; +#if PHP_VERSION_ID < 50500
+#define ZEND_EXECUTE_INTERNAL_PARAMS zend_execute_data *data, int ret TSRMLS_DC
+#define ZEND_EXECUTE_INTERNAL_PARAMS_PASSTHROUGH data, ret TSRMLS_CC
+#else
+#define ZEND_EXECUTE_INTERNAL_PARAMS zend_execute_data *execute_data_ptr, struct \
_zend_fcall_info *fci, int return_value_used TSRMLS_DC +#define \
ZEND_EXECUTE_INTERNAL_PARAMS_PASSTHROUGH execute_data_ptr, fci, return_value_used \
TSRMLS_CC +#endif

+static ZEND_DLEXPORT void (*_zend_execute_internal) (ZEND_EXECUTE_INTERNAL_PARAMS) = \
NULL; +
 static void scream_core_dump ()
 {
 	char gdbpath[MAXPATHLEN+1]="/tmp/scream.gdb.XXXXXX";
@@ -98,7 +112,11 @@
 	}
 }

+#if PHP_VERSION_ID < 50500
 ZEND_DLEXPORT void scream_execute (zend_op_array *ops TSRMLS_DC)
+#else
+ZEND_DLEXPORT void scream_execute (zend_execute_data *ops TSRMLS_DC)
+#endif
 {
 	size_t before, after, limit;

@@ -129,7 +147,7 @@
 	}
 }

-ZEND_DLEXPORT void scream_execute_internal(zend_execute_data *execute_data, int ret \
TSRMLS_DC) +ZEND_DLEXPORT void scream_execute_internal(ZEND_EXECUTE_INTERNAL_PARAMS)
 {
 	size_t before, after, limit;

@@ -138,12 +156,12 @@
 	if(before < 0.9*limit)
 	{
 		/* fast path */
-		_zend_execute_internal(execute_data, ret TSRMLS_CC);
+		_zend_execute_internal(ZEND_EXECUTE_INTERNAL_PARAMS_PASSTHROUGH);
 		after = zend_memory_usage(0 TSRMLS_CC);
 	}
 	else
 	{
-		_zend_execute_internal(execute_data, ret TSRMLS_CC);
+		_zend_execute_internal(ZEND_EXECUTE_INTERNAL_PARAMS_PASSTHROUGH);
 		after = zend_memory_usage(0 TSRMLS_CC);
 	}
 }
@@ -172,8 +190,8 @@
 	if(SCREAM_G(memory))
 	{
 		/* Replace zend_execute with our proxy */
-		_zend_execute = zend_execute;
-		zend_execute  = scream_execute;
+		_zend_execute = ZEND_EXECUTE_FUNC;
+		ZEND_EXECUTE_FUNC = scream_execute;

 		if(zend_execute_internal)
 		{



-- 
PECL CVS Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic