draft of the pure V version

pull/13721/head
Delyan Angelov 2022-03-13 09:51:09 +02:00
parent 17226830c8
commit cc8f40df86
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 5 additions and 1 deletions

View File

@ -79,12 +79,16 @@ mut:
real_sort_cb FnSortContextCB
}
fn vqsort_context_pure_v(base voidptr, nmemb usize, size usize, sort_cb FnSortContextCB, context voidptr) {
}
[inline; unsafe]
fn vqsort_context(base voidptr, nmemb usize, size usize, sort_cb FnSortContextCB, context voidptr) {
// See https://stackoverflow.com/questions/39560773/different-declarations-of-qsort-r-on-mac-and-linux
// ... and https://xkcd.com/927/ :-|
$if linux {
C.qsort_r(base, nmemb, size, voidptr(sort_cb), context)
vqsort_context_pure_v(base, nmemb, size, sort_cb, context)
// C.qsort_r(base, nmemb, size, voidptr(sort_cb), context)
} $else {
ic := VIndirectQSortContext{
real_context: context