summaryrefslogtreecommitdiff
path: root/Zend/zend.h
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-06-17 17:50:54 +0800
committerXinchen Hui <laruence@php.net>2014-06-18 12:09:37 +0800
commit6288bb8ffefe9cf9648b8d2190729c087b5c2586 (patch)
tree39b7b4afb3b9b902e047b05b1af824161487f20e /Zend/zend.h
parentaccaaf9d6e15e57a64a054d7b5ebc0998ee510a4 (diff)
downloadphp-git-6288bb8ffefe9cf9648b8d2190729c087b5c2586.tar.gz
Refactoring mysqlnd (incompleted, only mysqlnd ext compilable)
Diffstat (limited to 'Zend/zend.h')
-rw-r--r--Zend/zend.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index ea2c8f7a33..7ae85ad8cd 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -317,6 +317,21 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore
#define Z_ADDREF(z) Z_ADDREF_P(&(z))
#define Z_DELREF(z) Z_DELREF_P(&(z))
+#define Z_TRY_ADDREF_P(pz) do { \
+ if (Z_REFCOUNT_P((pz))) { \
+ Z_ADDREF_P((pz)); \
+ } \
+} while (0)
+
+#define Z_TRY_DELREF_P(pz) do { \
+ if (Z_REFCOUNT_P((pz))) { \
+ Z_DELREF_P((pz)); \
+ } \
+} while (0)
+
+#define Z_TRY_ADDREF(z) Z_TRY_ADDREF_P(&(z))
+#define Z_TRY_DELREF(z) Z_TRY_DELREF_P(&(z))
+
#if ZEND_DEBUG
#define zend_always_inline inline
#define zend_never_inline