1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
Fixes compile failures due to behavior changes of php-5.3
Christian Hoffmann <hoffie@gentoo.org>
Inspired by http://osdir.com/ml/fedora-extras-commits/2009-07/msg03478.html
and http://github.com/php/pecl-gearman/commit/e8e4579406d6b324caf0e0d4c0fcfffa0b68e8be
Index: ssh2-0.11.0/ssh2.c
===================================================================
--- ssh2-0.11.0.orig/ssh2.c
+++ ssh2-0.11.0/ssh2.c
@@ -48,7 +48,6 @@ int le_ssh2_pkey_subsys;
#endif
#ifdef ZEND_ENGINE_2
-static
ZEND_BEGIN_ARG_INFO(php_ssh2_first_arg_force_ref, 0)
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO()
@@ -56,6 +55,12 @@ static
static unsigned char php_ssh2_first_arg_force_ref[] = { 1, BYREF_FORCE };
#endif
+#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 3)
+# define SSH2_IS_CALLABLE(callable, check_flags, callable_name) zend_is_callable(callable, check_flags, callable_name)
+#else
+# define SSH2_IS_CALLABLE(callable, check_flags, callable_name) zend_is_callable(callable, check_flags, callable_name TSRMLS_CC)
+#endif
+
/* *************
* Callbacks *
************* */
@@ -252,12 +257,13 @@ static int php_ssh2_set_callback(LIBSSH2
{
zval **handler, *copyval;
void *internal_handler;
+ TSRMLS_FETCH();
if (zend_hash_find(ht, callback, callback_len + 1, (void**)&handler) == FAILURE) {
return 0;
}
- if (!handler || !*handler || !zend_is_callable(*handler, 0, NULL)) {
+ if (!handler || !*handler || !SSH2_IS_CALLABLE(*handler, 0, NULL)) {
return -1;
}
|