Skip to content

Commit afda266

Browse files
authored
Merge pull request #54 from remicollet/issue-81
fix build with 8.1.0alpha2
2 parents d4fe345 + 9fde6cf commit afda266

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

memprof.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,18 @@ static void (*old_zend_execute)(zend_execute_data *execute_data);
196196
static void (*old_zend_execute_internal)(zend_execute_data *execute_data_ptr, zval *return_value);
197197
#define zend_execute_fn zend_execute_ex
198198

199-
#if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
199+
#if PHP_VERSION_ID < 70200 /* PHP 7.1 */
200200
static void (*old_zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
201201
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
202-
#elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
202+
#elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
203203
static void (*old_zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args);
204204
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, format, args
205-
#else /* PHP 8 */
205+
#elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
206206
static void (*old_zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message);
207207
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
208+
#else /* PHP 8.1 */
209+
static void (*old_zend_error_cb)(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message);
210+
#define MEMPROF_ZEND_ERROR_CB_ARGS_PASSTHRU type, error_filename, error_lineno, message
208211
#endif
209212

210213
static PHP_INI_MH((*origOnChangeMemoryLimit)) = NULL;
@@ -764,17 +767,19 @@ static char * generate_filename(const char * format) {
764767
return filename;
765768
}
766769

767-
#if ZEND_MODULE_API_NO < 20170718 /* PHP 7.1 - 7.2 */
770+
#if PHP_VERSION_ID < 70200 /* PHP 7.1 */
768771
static void memprof_zend_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
769-
#elif ZEND_MODULE_API_NO < 20200930 /* PHP 7.3 - 7.4 */
772+
#elif PHP_VERSION_ID < 80000 /* PHP 7.2 - 7.4 */
770773
static void memprof_zend_error_cb(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args)
771-
#else /* PHP 8 */
774+
#elif PHP_VERSION_ID < 80100 /* PHP 8.0 */
772775
static void memprof_zend_error_cb(int type, const char *error_filename, const uint32_t error_lineno, zend_string *message)
776+
#else /* PHP 8.1 */
777+
static void memprof_zend_error_cb(int type, zend_string *error_filename, const uint32_t error_lineno, zend_string *message)
773778
#endif
774779
{
775780
char * filename;
776781
php_stream * stream;
777-
#if ZEND_MODULE_API_NO < 20200930
782+
#if PHP_VERSION_ID < 80000
778783
const char * msg = format;
779784
#else
780785
const char * msg = ZSTR_VAL(message);

0 commit comments

Comments
 (0)