From edbc313f1b4fb8407bf7d5acf63fbb0359c7fb2e Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 23 Apr 2018 12:26:50 +0300 Subject: [PATCH] fix build with PHP master update news and current version --- NEWS | 4 ++++ php_pinba.h | 2 +- pinba.c | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pinba.c b/pinba.c index 561b40c..a7b2ecf 100644 --- a/pinba.c +++ b/pinba.c @@ -1292,7 +1292,11 @@ static PHP_FUNCTION(pinba_timer_start) timeval_cvt(&t->tmp_ru_stime, &u.ru_stime); } /* refcount++ so that the timer is shut down only on request finish if not stopped manually */ +#if PHP_VERSION_ID < 70300 GC_REFCOUNT(rsrc)++; +#else + GC_ADDREF(rsrc); +#endif RETURN_RES(rsrc); } /* }}} */ @@ -1351,7 +1355,11 @@ static PHP_FUNCTION(pinba_timer_add) t->rsrc_id = rsrc->handle; /* refcount++ so that the timer is shut down only on request finish if not stopped manually */ +#if PHP_VERSION_ID < 70300 GC_REFCOUNT(rsrc)++; +#else + GC_ADDREF(rsrc); +#endif RETURN_RES(rsrc); } /* }}} */ @@ -1808,7 +1816,11 @@ static PHP_FUNCTION(pinba_timers_get) continue; } /* refcount++ */ +#if PHP_VERSION_ID < 70300 GC_REFCOUNT(rsrc)++; +#else + GC_ADDREF(rsrc); +#endif add_next_index_resource(return_value, rsrc); } }