Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 2090367

Browse files
committed
Merge branch 'mkoppanen' into integration
2 parents 402cf40 + 63f97c7 commit 2090367

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

php_memcached.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,11 @@ static int php_memc_set_option(php_memc_t *i_obj, long option, zval *value TSRML
21032103
*/
21042104
flag = (memcached_behavior) option;
21052105
convert_to_long(value);
2106-
if (flag < 0 || flag >= MEMCACHED_BEHAVIOR_MAX ||
2106+
if (flag < 0 ||
2107+
/* MEMCACHED_BEHAVIOR_MAX was added in somewhere around 0.36 or 0.37 */
2108+
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x00037000
2109+
flag >= MEMCACHED_BEHAVIOR_MAX ||
2110+
#endif
21072111
memcached_behavior_set(m_obj->memc, flag, (uint64_t)Z_LVAL_P(value)) != MEMCACHED_SUCCESS) {
21082112
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error setting memcached option");
21092113
return 0;

0 commit comments

Comments
 (0)