1 #include <ccan/asort/asort.h>
4 void _asort(void *base, size_t nmemb, size_t size,
5 int(*compar)(const void *, const void *, const void *ctx),
8 #if HAVE_NESTED_FUNCTIONS
9 /* This gives bogus "warning: no previous prototype for ‘cmp’"
10 * with gcc 4 with -Wmissing-prototypes. But there's no way
11 * to predeclare it, so we lose. */
12 int cmp(const void *a, const void *b)
14 return compar(a, b, ctx);
16 qsort(base, nmemb, size, cmp);
18 #error "Need to open-code quicksort?"
19 /* qsort is a classic "needed more real-life testing" API. */