From 96f1ca95d5fbe8ff5bcf8802bb40d366409ea2fb Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 19 Oct 2024 11:19:32 -0400 Subject: array: Add test for array_sort() Signed-off-by: Andrew Opalach --- include/al/array_sort.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/al') diff --git a/include/al/array_sort.h b/include/al/array_sort.h index 51011f4..8d138d0 100644 --- a/include/al/array_sort.h +++ b/include/al/array_sort.h @@ -1,6 +1,8 @@ #ifndef _AL_ARRAY_SORT_H #define _AL_ARRAY_SORT_H +#include "lib.h" + #define AL_INSERSION_SORT(data, type, count, cmp) \ do { \ s32 i = 1; \ @@ -14,6 +16,10 @@ data[j + 1] = x; \ i++; \ } \ - } while (0); + } while (0) + +#if AL_USE_STDLIB +#define AL_STDLIB_QSORT(data, type, count, cmp) qsort(data, count, sizeof(type), cmp) +#endif #endif // _AL_ARRAY_SORT_H -- cgit v1.2.3-101-g0448