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
|
--- hiredis-2.2.2.orig/setup.py
+++ hiredis-2.2.2/setup.py
@@ -18,8 +18,7 @@
def get_sources():
- hiredis_sources = ("alloc", "async", "hiredis", "net", "read", "sds", "sockcompat")
- return sorted(glob.glob("src/*.c") + ["vendor/hiredis/%s.c" % src for src in hiredis_sources])
+ return sorted(glob.glob("src/*.c"))
def get_linker_args():
@@ -38,17 +37,16 @@
def get_libraries():
if 'win32' in sys.platform:
- return ["ws2_32", ]
+ return ["ws2_32", "hiredis"]
else:
- return []
+ return ["hiredis"]
ext = Extension("hiredis.hiredis",
sources=get_sources(),
extra_compile_args=get_compiler_args(),
extra_link_args=get_linker_args(),
- libraries=get_libraries(),
- include_dirs=["vendor"])
+ libraries=get_libraries())
setup(
name="hiredis",
--- hiredis-2.2.2.orig/src/pack.c
+++ hiredis-2.2.2/src/pack.c
@@ -16,7 +16,7 @@
extern sds sdsnewlen(const void *init, size_t initlen);
#endif
-#include <hiredis/sdsalloc.h>
+#include <hiredis/sds.h>
PyObject *
pack_command(PyObject *cmd)
@@ -32,7 +32,7 @@
}
Py_ssize_t tokens_number = PyTuple_Size(cmd);
- sds *tokens = s_malloc(sizeof(sds) * tokens_number);
+ sds *tokens = sds_malloc(sizeof(sds) * tokens_number);
if (tokens == NULL)
{
return PyErr_NoMemory();
|