use wrapper macro fro zend_list_insert

This commit is contained in:
Shuhei Tanuma 2012-06-26 00:30:45 +09:00
parent b9f45169b0
commit ccc05f1032
2 changed files with 9 additions and 2 deletions

View File

@ -2247,7 +2247,7 @@ PHP_FUNCTION(uv_getaddrinfo)
TSRMLS_SET_CTX(uv->thread_ctx); TSRMLS_SET_CTX(uv->thread_ctx);
uv->getaddr_cb = callback; uv->getaddr_cb = callback;
uv->uv.addrinfo.data = uv; uv->uv.addrinfo.data = uv;
uv->resource_id = zend_list_insert(uv, uv_resource_handle TSRMLS_CC); uv->resource_id = PHP_UV_LIST_INSERT(uv, uv_resource_handle);
uv_getaddrinfo(loop, &uv->uv.addrinfo, php_uv_getaddrinfo_cb, node, service, &hint); uv_getaddrinfo(loop, &uv->uv.addrinfo, php_uv_getaddrinfo_cb, node, service, &hint);
} }
@ -4047,7 +4047,7 @@ PHP_FUNCTION(uv_fs_write)
uv->type = uv_type; \ uv->type = uv_type; \
PHP_UV_INIT_ZVALS(uv) \ PHP_UV_INIT_ZVALS(uv) \
TSRMLS_SET_CTX(uv->thread_ctx); \ TSRMLS_SET_CTX(uv->thread_ctx); \
uv->resource_id = zend_list_insert(uv, uv_resource_handle TSRMLS_CC); \ uv->resource_id = PHP_UV_LIST_INSERT(uv, uv_resource_handle); \
} }
#define PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop) \ #define PHP_UV_FETCH_UV_DEFAULT_LOOP(loop, zloop) \

View File

@ -123,6 +123,13 @@ typedef struct {
#define PHP_UV_RWLOCK_RESOURCE_NAME "uv_rwlock" #define PHP_UV_RWLOCK_RESOURCE_NAME "uv_rwlock"
#define PHP_UV_MUTEX_RESOURCE_NAME "uv_mutex" #define PHP_UV_MUTEX_RESOURCE_NAME "uv_mutex"
#ifdef PHP_VERSION_ID >= 50399
#define PHP_UV_LIST_INSERT(type, handle) zend_list_insert(type, handle TSRMLS_CC)
#else
#define PHP_UV_LIST_INSERT(type, handle) zend_list_insert(type, handle)
#endif
/* TODO: remove these macro when libuv provides uv_inet_ntop & uv_inet_pton */ /* TODO: remove these macro when libuv provides uv_inet_ntop & uv_inet_pton */
#ifdef PHP_WIN32 #ifdef PHP_WIN32
# include "libuv/src/ares/inet_net_pton.h" # include "libuv/src/ares/inet_net_pton.h"