Skip to content

Commit f36dbf2

Browse files
committed
windows: fix building of c_shard_info.pyx
without this, that `c_shard_info.c` fails to compile like the following: ``` cassandra\c_shard_info.c(3083): error C2065: '__uint128_t': undeclared identifier cassandra\c_shard_info.c(3083): error C2146: syntax error: missing ')' before identifier '__pyx_v_biased_token' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' cassandra\c_shard_info.c(3083): error C2059: syntax error: ')' ```
1 parent fe33cb8 commit f36dbf2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cassandra/c_shard_info.pyx

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
from libc.stdint cimport INT64_MIN, UINT32_MAX, uint64_t, int64_t
1616

1717
cdef extern from *:
18+
"""
19+
#include <stdint.h>
20+
21+
// windows doesn't have __uint128_t, do we need to define ourself
22+
#if defined(_WIN32) || defined(MS_WINDOWS) || defined(_MSC_VER)
23+
#define __uint128_t unsigned long long
24+
#endif
25+
26+
"""
1827
ctypedef unsigned int __uint128_t
1928

2029
cdef class ShardingInfo():

0 commit comments

Comments
 (0)