summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2015-02-08 14:08:31 +0000
committerJakub Zelenka <bukka@php.net>2015-02-08 14:08:31 +0000
commitf2825042b4dd9aa941a080c027f15f41c1b9e4bc (patch)
tree2e7d97c1dfd4aeabb506ffdd206a612b82adea8d /main/php_streams.h
parent0a81f9a0bd36deac8707949acbcf92f612b60e8e (diff)
parentce9f52adcdfb19f70dc4274f3587e58ac07995bd (diff)
downloadphp-git-f2825042b4dd9aa941a080c027f15f41c1b9e4bc.tar.gz
Merge branch 'master' into jsond
Conflicts: ext/json/json.c
Diffstat (limited to 'main/php_streams.h')
-rw-r--r--main/php_streams.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 6240fdd653..3cd0c047cd 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -253,8 +253,20 @@ END_EXTERN_C()
* when the resources are auto-destructed */
#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), -1, "stream", NULL, 2, php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval(xstr, pzval) do { \
+ if (((xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), \
+ "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
+ RETURN_FALSE; \
+ } \
+} while (0)
+#define php_stream_from_res(xstr, res) do { \
+ if (((xstr) = (php_stream*)zend_fetch_resource2((res), \
+ "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
+ RETURN_FALSE; \
+ } \
+} while (0)
+#define php_stream_from_res_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((res), "stream", php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", php_file_le_stream(), php_file_le_pstream())
BEGIN_EXTERN_C()
PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);