Skip to content

Commit

Permalink
Fix: qsort_r argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Jan 4, 2024
1 parent ebc873e commit cf07f5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ sz_size_t hybrid_sort_c(sz_sequence_t *sequence) {
}

// Sort the full strings.
// The MacOS and Linux version have different argument order.
#if defined(__APPLE__)
qsort_r(sequence->order, sequence->count, sizeof(sz_size_t), sequence, hybrid_sort_c_compare_strings);
#else
qsort_r(sequence->order, sequence->count, sizeof(sz_size_t), hybrid_sort_c_compare_strings, sequence);
#endif

return sequence->count;
}
Expand Down

0 comments on commit cf07f5c

Please sign in to comment.