summary |
shortlog |
log |
commit | commitdiff |
tree |
github
raw |
patch |
inline | side by side (from parent 1:
d7101da)
git-svn-id: http://svn.php.net/repository/pecl/ares/trunk@272948
c90b9560-bf6c-de11-be94-
00142212c4b1
#define local inline
#ifndef ZEND_ENGINE_2
#define local inline
#ifndef ZEND_ENGINE_2
-# define zend_is_callable(a,b,c) 1
+# define IS_CALLABLE(a,b,c) 1
# ifndef ZTS
# undef TSRMLS_SET_CTX
# define TSRMLS_SET_CTX
# ifndef ZTS
# undef TSRMLS_SET_CTX
# define TSRMLS_SET_CTX
# define TSRMLS_FETCH_FROM_CTX
# endif
#endif
# define TSRMLS_FETCH_FROM_CTX
# endif
#endif
+#if (PHP_MAJOR_VERSION > 5) || ((PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 3))
+# define ADDREF(z) Z_ADDREF_P(z)
+# define IS_CALLABLE(a,b,c) zend_is_callable((a), (b), (c) TSRMLS_CC)
+#else
+# define ADDREF(z) ZVAL_ADDREF(z)
+# define IS_CALLABLE(a,b,c) zend_is_callable((a), (b), (c))
+#endif
#define PHP_ARES_LE_NAME "AsyncResolver"
#define PHP_ARES_QUERY_LE_NAME "AsyncResolverQuery"
#define PHP_ARES_LE_NAME "AsyncResolver"
#define PHP_ARES_QUERY_LE_NAME "AsyncResolverQuery"
query->error = -1;
if (callback) {
query->error = -1;
if (callback) {
query->callback = callback;
}
query->callback = callback;
}
/* }}} */
/* {{{ callbacks */
/* }}} */
/* {{{ callbacks */
-static void php_ares_callback_func(void *aq, int status, unsigned char *abuf, int alen)
+static void php_ares_callback_func_old(void *aq, int status, unsigned char *abuf, int alen)
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[3], *retval;
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[3], *retval;
-static void php_ares_host_callback_func(void *aq, int status, struct hostent *hostent)
+static void php_ares_host_callback_func_old(void *aq, int status, struct hostent *hostent)
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[3], *retval;
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[3], *retval;
}
#ifdef HAVE_ARES_GETNAMEINFO
}
#ifdef HAVE_ARES_GETNAMEINFO
-static void php_ares_nameinfo_callback_func(void *aq, int status, char *node, char *service)
+static void php_ares_nameinfo_callback_func_old(void *aq, int status, char *node, char *service)
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[4], *retval;
{
php_ares_query *q = (php_ares_query *) aq;
zval *params[4], *retval;
-# define php_ares_callback_func php_ares_callback_func_new
-# define php_ares_host_callback_func php_ares_host_callback_func_new
+# define php_ares_callback_func php_ares_callback_func_old
+# define php_ares_host_callback_func php_ares_host_callback_func_old
# ifdef HAVE_ARES_GETNAMEINFO
# ifdef HAVE_ARES_GETNAMEINFO
-# define php_ares_nameinfo_callback_func php_ares_nameinfo_callback_func_new
+# define php_ares_nameinfo_callback_func php_ares_nameinfo_callback_func_old
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
RETURN_ARES_CB_ERROR("second");
}
RETURN_ARES_CB_ERROR("second");
}
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
RETURN_ARES_CB_ERROR("second");
}
RETURN_ARES_CB_ERROR("second");
}
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
RETURN_ARES_CB_ERROR("second");
}
RETURN_ARES_CB_ERROR("second");
}
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
RETURN_ARES_CB_ERROR("second");
}
RETURN_ARES_CB_ERROR("second");
}
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
PHP_ARES_CB_ERROR("second");
RETURN_FALSE;
}
PHP_ARES_CB_ERROR("second");
RETURN_FALSE;
}
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
}
ZEND_FETCH_RESOURCE(ares, php_ares *, &rsrc, -1, PHP_ARES_LE_NAME, le_ares);
- if (cb && !zend_is_callable(cb, 0, NULL)) {
+ if (cb && !IS_CALLABLE(cb, 0, NULL)) {
PHP_ARES_CB_ERROR("second");
RETURN_FALSE;
}
PHP_ARES_CB_ERROR("second");
RETURN_FALSE;
}