Skip to content

Commit cfc67e0

Browse files
committed
Update patch to resolve cover incompatibility
1 parent 4dd645c commit cfc67e0

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

cpython-unix/build-zstd.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ "${CC}" = "musl-clang" ]; then
3333
# `qsort_r` is actually available so we patch it to include a check for glibc.
3434
patch -p1 <<EOF
3535
diff --git a/dictBuilder/cover.c b/dictBuilder/cover.c
36-
index 5e6e8bc..6ca72a1 100644
36+
index 2ef33c7..078e2ee 100644
3737
--- a/dictBuilder/cover.c
3838
+++ b/dictBuilder/cover.c
3939
@@ -241,7 +241,7 @@ typedef struct {
@@ -45,6 +45,24 @@ index 5e6e8bc..6ca72a1 100644
4545
/* C90 only offers qsort() that needs a global context. */
4646
static COVER_ctx_t *g_coverCtx = NULL;
4747
#endif
48+
@@ -290,7 +290,7 @@ static int COVER_cmp8(COVER_ctx_t *ctx, const void *lp, const void *rp) {
49+
*/
50+
#if (defined(_WIN32) && defined(_MSC_VER)) || defined(__APPLE__)
51+
static int WIN_CDECL COVER_strict_cmp(void* g_coverCtx, const void* lp, const void* rp) {
52+
-#elif defined(_GNU_SOURCE)
53+
+#elif defined(_GNU_SOURCE) && defined(__GLIBC__)
54+
static int COVER_strict_cmp(const void *lp, const void *rp, void *g_coverCtx) {
55+
#else /* C90 fallback.*/
56+
static int COVER_strict_cmp(const void *lp, const void *rp) {
57+
@@ -306,7 +306,7 @@ static int COVER_strict_cmp(const void *lp, const void *rp) {
58+
*/
59+
#if (defined(_WIN32) && defined(_MSC_VER)) || defined(__APPLE__)
60+
static int WIN_CDECL COVER_strict_cmp8(void* g_coverCtx, const void* lp, const void* rp) {
61+
-#elif defined(_GNU_SOURCE)
62+
+#elif defined(_GNU_SOURCE) && defined(__GLIBC__)
63+
static int COVER_strict_cmp8(const void *lp, const void *rp, void *g_coverCtx) {
64+
#else /* C90 fallback.*/
65+
static int COVER_strict_cmp8(const void *lp, const void *rp) {
4866
@@ -328,7 +328,7 @@ static void stableSort(COVER_ctx_t *ctx) {
4967
qsort_r(ctx->suffix, ctx->suffixSize, sizeof(U32),
5068
ctx,

0 commit comments

Comments
 (0)