com php-src: Keep Z_IMMUTABLE*() macros for compati bility: Zend/zend_types.h

[email protected] (Dmitry Stogov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    476866783cd8415849297cb8c5f0cc8b54afe9ff
Author:    Dmitry Stogov <[email protected]>         Tue, 2 May 2017 10:00:54 +0300
Parents:   cdcfb4903d8657619cdb7b08e182acdebd8bd8a9
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=476866783cd8415849297cb8c5f0cc8b54afe9ff

Log:
Keep Z_IMMUTABLE*() macros for compatibility

Changed paths:
  M  Zend/zend_types.h


Diff:
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 7860e2b..caa68e2 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -535,6 +535,12 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
 #define Z_COPYABLE(zval)			((Z_TYPE_FLAGS(zval) & IS_TYPE_COPYABLE) != 0)
 #define Z_COPYABLE_P(zval_p)		Z_COPYABLE(*(zval_p))
 
+/* deprecated: (IMMUTABLE is the same as COPYABLE && !REFCOUED) */
+#define Z_IMMUTABLE(zval)			((Z_TYPE_FLAGS(zval) & (IS_TYPE_REFCOUNTED|IS_TYPE_COPYABLE)) == IS_TYPE_COPYABLE)
+#define Z_IMMUTABLE_P(zval_p)		Z_IMMUTABLE(*(zval_p))
+#define Z_OPT_IMMUTABLE(zval)		Z_IMMUTABLE(zval_p)
+#define Z_OPT_IMMUTABLE_P(zval_p)	Z_IMMUTABLE(*(zval_p))
+
 /* the following Z_OPT_* macros make better code when Z_TYPE_INFO accessed before */
 #define Z_OPT_TYPE(zval)			(Z_TYPE_INFO(zval) & Z_TYPE_MASK)
 #define Z_OPT_TYPE_P(zval_p)		Z_OPT_TYPE(*(zval_p))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.