summaryrefslogtreecommitdiffstats
path: root/edbc313f1b4fb8407bf7d5acf63fbb0359c7fb2e.patch
blob: 59a233819946c3b0d13933794c5000ff228d5ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From edbc313f1b4fb8407bf7d5acf63fbb0359c7fb2e Mon Sep 17 00:00:00 2001
From: Antony Dovgal <tony@daylessday.org>
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);
 		}
 	}