summaryrefslogtreecommitdiff
path: root/dev-php/pecl-memcached/files/libmc-1.09-fix.diff
blob: 1b014dfd6422e73204c2ccb4b893d6eddd0c006d (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
This patch is fixes to compile with newer versions of libmemcached ported from the fork at:
https://github.com/paravoid/php-memcached/commit/37069e18ad399a8cc03d5fe9757e1481814ecb44

X-Ported-By: Allen Parker <infowolfe@gmail.com>
Signed-off-by: Allen Parker <infowolfe@gmail.com>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

diff -Nurw memcached-2.1.0/php_memcached.c memcached-2.1.0-fixed/php_memcached.c
--- memcached-2.1.0-broken/php_memcached.c	2012-08-07 05:02:46.000000000 +0000
+++ memcached-2.1.0/php_memcached.c	2013-12-16 06:14:17.420837278 +0000
@@ -315,9 +315,15 @@
 static void php_memc_getDelayed_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key);
 static memcached_return php_memc_do_cache_callback(zval *memc_obj, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char *key, size_t key_len, zval *value TSRMLS_DC);
 static int php_memc_do_result_callback(zval *memc_obj, zend_fcall_info *fci, zend_fcall_info_cache *fcc, memcached_result_st *result TSRMLS_DC);
+#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009
+static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context);
+static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context);
+static memcached_return php_memc_do_version_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context);
+#else
 static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
 static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
 static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context);
+#endif
 static void php_memc_destroy(struct memc_obj *m_obj, zend_bool persistent TSRMLS_DC);
 
 /****************************************
@@ -1855,7 +1861,7 @@
 	zval **z_host, **z_port, **z_weight = NULL;
 	uint32_t weight = 0;
 	int   entry_size, i = 0;
-	memcached_server_st *list = NULL;
+	memcached_server_list_st list = NULL;
 	memcached_return status;
 	MEMC_METHOD_INIT_VARS;
 
@@ -2573,7 +2579,11 @@
 /* }}} */
 
 /* {{{ internal API functions */
+#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009
+static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context)
+#else
 static memcached_return php_memc_do_serverlist_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
+#endif
 {
 	struct callbackContext* context = (struct callbackContext*) in_context;
 	zval *array;
@@ -2590,7 +2600,11 @@
 	return MEMCACHED_SUCCESS;
 }
 
+#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009
+static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context)
+#else
 static memcached_return php_memc_do_stats_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
+#endif
 {
 	char *hostport = NULL;
 	int hostport_len;
@@ -2634,7 +2648,11 @@
 	return MEMCACHED_SUCCESS;
 }
 
+#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000009
+static memcached_return php_memc_do_version_callback(const memcached_st *ptr, const memcached_instance_st *instance, void *in_context)
+#else
 static memcached_return php_memc_do_version_callback(const memcached_st *ptr, memcached_server_instance_st instance, void *in_context)
+#endif
 {
 	char *hostport = NULL;
 	char version[16];