mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +01:00
use wrapper macro fro zend_list_insert
This commit is contained in:
parent
b9f45169b0
commit
ccc05f1032
4
php_uv.c
4
php_uv.c
@ -2247,7 +2247,7 @@ PHP_FUNCTION(uv_getaddrinfo)
|
||||
TSRMLS_SET_CTX(uv->thread_ctx);
|
||||
uv->getaddr_cb = callback;
|
||||
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);
|
||||
}
|
||||
@ -4047,7 +4047,7 @@ PHP_FUNCTION(uv_fs_write)
|
||||
uv->type = uv_type; \
|
||||
PHP_UV_INIT_ZVALS(uv) \
|
||||
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) \
|
||||
|
7
php_uv.h
7
php_uv.h
@ -123,6 +123,13 @@ typedef struct {
|
||||
#define PHP_UV_RWLOCK_RESOURCE_NAME "uv_rwlock"
|
||||
#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 */
|
||||
#ifdef PHP_WIN32
|
||||
# include "libuv/src/ares/inet_net_pton.h"
|
||||
|
Loading…
Reference in New Issue
Block a user