summaryrefslogtreecommitdiffstats
path: root/memprof-php81.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-07-02 15:05:07 +0200
committerRemi Collet <remi@remirepo.net>2021-07-02 15:05:07 +0200
commit67aba1a929b8dbf80febcac6bec1159246a5a595 (patch)
tree31d5f163b8821e615acc01473f0834a8e4d88b49 /memprof-php81.patch
parent1afeb875434ce18ccbf11dbba0814d68587376c6 (diff)
update to 3.0.1
add patch for PHP 8.1 from https://github.com/arnaud-lb/php-memory-profiler/pull/54
Diffstat (limited to 'memprof-php81.patch')
-rw-r--r--memprof-php81.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/memprof-php81.patch b/memprof-php81.patch
new file mode 100644
index 0000000..46840ec
--- /dev/null
+++ b/memprof-php81.patch
@@ -0,0 +1,59 @@
+From 9fde6cfe03c96d9f448484aa137901eca2d44d0c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 2 Jul 2021 14:44:34 +0200
+Subject: [PATCH] fix build with 8.1.0alpha2
+
+---
+ memprof.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/memprof.c b/memprof.c
+index a85b5bd..d754838 100644
+--- a/memprof.c
++++ b/memprof.c
+@@ -196,15 +196,18 @@ static void (*old_zend_execute)(zend_execute_data *execute_data);
+ static void (*old_zend_execute_internal)(zend_execute_data *execute_data_ptr, zval *return_value);
+ #define zend_execute_fn zend_execute_ex
+
+-#if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
++#if PHP_VERSION_ID < 70200 /* PHP 7.1 */
+ static void (*old_zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+ #define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
+-#elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
++#elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
+ static void (*old_zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args);
+ #define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
+-#else /* PHP 8 */
++#elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
+ static void (*old_zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
+ #define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
++#else /* PHP 8.1 */
++static void (*old_zend_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
++#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
+ #endif
+
+ static PHP_INI_MH((*origOnChangeMemoryLimit)) = NULL;
+@@ -764,17 +767,19 @@ static char * generate_filename(const char * format) {
+ return filename;
+ }
+
+-#if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
++#if PHP_VERSION_ID < 70200 /* PHP 7.1 */
+ static void memprof_zend_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
+-#elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
++#elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
+ static void memprof_zend_error_cb(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args)
+-#else /* PHP 8 */
++#elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
+ static void memprof_zend_error_cb(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message)
++#else /* PHP 8.1 */
++static void memprof_zend_error_cb(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message)
+ #endif
+ {
+ char * filename;
+ php_stream * stream;
+-#if ZEND_MODULE_API_NO < 20200930
++#if PHP_VERSION_ID < 80000
+ const char * msg = format;
+ #else
+ const char * msg = ZSTR_VAL(message);