Skip to content

Commit ebe4c1f

Browse files
committed
manage to compile on windows
Use C++ compiler to build.
1 parent 58eb7d0 commit ebe4c1f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

msgpack/_msgpack.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def unpackb(object packed, object object_hook=None, object list_hook=None, bint
222222
template_init(&ctx)
223223
ctx.user.use_list = use_list
224224
ctx.user.object_hook = ctx.user.list_hook = NULL
225-
ctx.user.encoding = enc
226-
ctx.user.unicode_errors = err
225+
ctx.user.encoding = <const_char_ptr>enc
226+
ctx.user.unicode_errors = <const_char_ptr>err
227227
if object_hook is not None:
228228
if not PyCallable_Check(object_hook):
229229
raise TypeError("object_hook must be a callable.")

msgpack/pack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static inline int msgpack_pack_write(msgpack_packer* pk, const char *data, size_
7777

7878
if (len + l > bs) {
7979
bs = (len + l) * 2;
80-
buf = realloc(buf, bs);
80+
buf = (char*)realloc(buf, bs);
8181
if (!buf) return -1;
8282
}
8383
memcpy(buf + len, data, l);

setup.py

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def __init__(self, *args, **kwargs):
5353
sources=sources,
5454
libraries=libraries,
5555
include_dirs=['.'],
56+
language='c++',
5657
)
5758
del sources, libraries
5859

0 commit comments

Comments
 (0)