From cc8f40df8607aebee8ef177173d12deaaf95ddf7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 13 Mar 2022 09:51:09 +0200 Subject: [PATCH] draft of the pure V version --- vlib/builtin/cfns_wrapper.c.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/cfns_wrapper.c.v b/vlib/builtin/cfns_wrapper.c.v index 5038a3b9ec..32aff567ba 100644 --- a/vlib/builtin/cfns_wrapper.c.v +++ b/vlib/builtin/cfns_wrapper.c.v @@ -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