diff --git a/setup.py b/setup.py index 7e70807..905df59 100644 --- a/setup.py +++ b/setup.py @@ -22,16 +22,23 @@ def get_sources(): return sorted(glob.glob("src/*.c") + ["vendor/hiredis/%s.c" % src for src in hiredis_sources]) +def get_linker_args(): + if 'win32' in sys.platform or 'darwin' in sys.platform: + return [] + else: + return ["-Wl,-Bsymbolic", ] + + def get_compiler_args(): if 'win32' in sys.platform: return [] else: - return ["-std=c99", "-static-libstdc++", "-O2"] + return ["-std=c99"] def get_libraries(): if 'win32' in sys.platform: - return ["ws2_32",] + return ["ws2_32", ] else: return [] @@ -39,6 +46,7 @@ def get_libraries(): 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"]) diff --git a/src/pack.c b/src/pack.c index e92efe7..443e9d3 100644 --- a/src/pack.c +++ b/src/pack.c @@ -37,7 +37,7 @@ pack_command(PyObject *cmd) { return PyErr_NoMemory(); } - + memset(tokens, 0, sizeof(sds) * tokens_number); size_t *lengths = hi_malloc(sizeof(size_t) * tokens_number);