Skip to content

Commit 69c6c04

Browse files
Added RedisArray and RedisCluster to config.w32 and more win32 fixes
Manually picked from: 6c377ee
1 parent dad6cd9 commit 69c6c04

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

config.w32

+27-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
// vim: ft=javascript:
2-
3-
ARG_ENABLE("redis", "whether to enable redis support", "yes");
4-
ARG_ENABLE("redis-session", "whether to enable sessions", "yes");
5-
ARG_ENABLE("redis-igbinary", "whether to enable igbinary serializer support", "no");
6-
7-
if (PHP_REDIS != "no") {
8-
var sources = "redis.c library.c redis_array.c redis_array_impl.c";
9-
if (PHP_REDIS_SESSION != "no") {
10-
ADD_SOURCES(configure_module_dirname, "redis_session.c", "redis");
11-
ADD_EXTENSION_DEP("redis", "session");
12-
ADD_FLAG("CFLAGS_REDIS", ' /D PHP_SESSION=1 ');
13-
AC_DEFINE("HAVE_REDIS_SESSION", 1);
14-
}
15-
16-
if (PHP_REDIS_IGBINARY != "no") {
17-
if (CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_REDIS", configure_module_dirname + "\\..\\igbinary")) {
18-
19-
ADD_EXTENSION_DEP("redis", "igbinary");
20-
AC_DEFINE("HAVE_REDIS_IGBINARY", 1);
21-
} else {
22-
WARNING("redis igbinary support not enabled");
23-
}
24-
}
25-
26-
EXTENSION("redis", sources);
27-
}
28-
1+
// vim: ft=javascript:
2+
3+
ARG_ENABLE("redis", "whether to enable redis support", "yes");
4+
ARG_ENABLE("redis-session", "whether to enable sessions", "yes");
5+
ARG_ENABLE("redis-igbinary", "whether to enable igbinary serializer support", "no");
6+
7+
if (PHP_REDIS != "no") {
8+
var sources = "redis.c library.c redis_array.c redis_array_impl.c";
9+
if (PHP_REDIS_SESSION != "no") {
10+
ADD_SOURCES(configure_module_dirname, "redis_session.c", "redis");
11+
ADD_EXTENSION_DEP("redis", "session");
12+
ADD_FLAG("CFLAGS_REDIS", ' /D PHP_SESSION=1 ');
13+
AC_DEFINE("HAVE_REDIS_SESSION", 1);
14+
}
15+
16+
if (PHP_REDIS_IGBINARY != "no") {
17+
if (CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_REDIS", configure_module_dirname + "\\..\\igbinary")) {
18+
19+
ADD_EXTENSION_DEP("redis", "igbinary");
20+
AC_DEFINE("HAVE_REDIS_IGBINARY", 1);
21+
} else {
22+
WARNING("redis igbinary support not enabled");
23+
}
24+
}
25+
26+
EXTENSION("redis", sources);
27+
}

redis_array_impl.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,14 @@ ra_find_node(RedisArray *ra, const char *key, int key_len, int *out_pos TSRMLS_D
463463
}
464464
efree(out);
465465
} else {
466+
uint64_t h64;
467+
466468
/* hash */
467469
hash = rcrc32(out, out_len);
468470
efree(out);
469471

470472
/* get position on ring */
471-
uint64_t h64 = hash;
473+
h64 = hash;
472474
h64 *= ra->count;
473475
h64 /= 0xffffffff;
474476
pos = (int)h64;
@@ -565,6 +567,7 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) {
565567
zval *z_keys, **z_entry_pp;
566568
HashPosition pos;
567569
MAKE_STD_ZVAL(z_keys);
570+
HashPosition pos;
568571
#if PHP_VERSION_ID > 50300
569572
array_init_size(z_keys, zend_hash_num_elements(Z_ARRVAL_P(z_pairs)));
570573
#else

redis_array_impl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#define REDIS_ARRAY_IMPL_H
33

44
#ifdef PHP_WIN32
5-
#include "win32/php_stdint.h"
5+
#include <win32/php_stdint.h>
66
#else
77
#include <stdint.h>
88
#endif
9+
910
#include "common.h"
1011
#include "redis_array.h"
1112

0 commit comments

Comments
 (0)