qsort - Direct implementation without using fl::sort to avoid proxy iterator issues
| 438 | |
| 439 | // qsort - Direct implementation without using fl::sort to avoid proxy iterator issues |
| 440 | void qsort(void* base, size_t nmemb, size_t size, qsort_compare_fn compar) { |
| 441 | if (!base || nmemb <= 1 || size == 0 || !compar) { |
| 442 | return; |
| 443 | } |
| 444 | |
| 445 | char* arr = static_cast<char*>(base); |
| 446 | detail::qsort_impl(arr, nmemb, size, compar); |
| 447 | } |
| 448 | |
| 449 | u32 rand() { |
| 450 | return static_cast<u32>(::rand()); |