@@ -33,7 +33,7 @@ if [ "${CC}" = "musl-clang" ]; then
33
33
# `qsort_r` is actually available so we patch it to include a check for glibc.
34
34
patch -p1 << EOF
35
35
diff --git a/dictBuilder/cover.c b/dictBuilder/cover.c
36
- index 5e6e8bc..6ca72a1 100644
36
+ index 2ef33c7..078e2ee 100644
37
37
--- a/dictBuilder/cover.c
38
38
+++ b/dictBuilder/cover.c
39
39
@@ -241,7 +241,7 @@ typedef struct {
@@ -45,6 +45,24 @@ index 5e6e8bc..6ca72a1 100644
45
45
/* C90 only offers qsort() that needs a global context. */
46
46
static COVER_ctx_t *g_coverCtx = NULL;
47
47
#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) {
48
66
@@ -328,7 +328,7 @@ static void stableSort(COVER_ctx_t *ctx) {
49
67
qsort_r(ctx->suffix, ctx->suffixSize, sizeof(U32),
50
68
ctx,
0 commit comments