summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-31 18:16:08 +0800
committerXinchen Hui <laruence@php.net>2014-07-31 18:16:08 +0800
commit863a603fada3ce107cb402683bc79dce1359c463 (patch)
treeae0426fb8fe168d56138464256b09f639d33176f /main/php_streams.h
parent238a3167e601dd74772182e354298578c1c50021 (diff)
parent534dfa84a1347f88d92fdfe58d9cd5b3ddc41462 (diff)
downloadphp-git-863a603fada3ce107cb402683bc79dce1359c463.tar.gz
Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng
Diffstat (limited to 'main/php_streams.h')
-rw-r--r--main/php_streams.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 2a142b99c2..fac15ce3e4 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -202,9 +202,7 @@ struct _php_stream {
* PHP_STREAM_FCLOSE_XXX as appropriate */
int fclose_stdiocast;
FILE *stdiocast; /* cache this, otherwise we might leak! */
-#if ZEND_DEBUG
int __exposed; /* non-zero if exposed as a zval somewhere */
-#endif
char *orig_path;
php_stream_context *context;
@@ -243,17 +241,12 @@ END_EXTERN_C()
#define php_stream_alloc(ops, thisptr, persistent_id, mode) _php_stream_alloc((ops), (thisptr), (persistent_id), (mode) STREAMS_CC TSRMLS_CC)
#define php_stream_get_resource_id(stream) ((php_stream *)(stream))->res->handle
-#if ZEND_DEBUG
/* use this to tell the stream that it is OK if we don't explicitly close it */
-# define php_stream_auto_cleanup(stream) { (stream)->__exposed++; }
+#define php_stream_auto_cleanup(stream) { (stream)->__exposed++; }
/* use this to assign the stream to a zval and tell the stream that is
* has been exported to the engine; it will expect to be closed automatically
* when the resources are auto-destructed */
-# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; }
-#else
-# define php_stream_auto_cleanup(stream) /* nothing */
-# define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); }
-#endif
+#define php_stream_to_zval(stream, zval) { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; }
#define php_stream_from_zval(xstr, pzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (pzval), -1, "stream", php_file_le_stream(), php_file_le_pstream())
#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((pzval) TSRMLS_CC, -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream())