← Back to index
|
Original Bugzilla link
Bug 11520 – [bionic] qsort is missing on linux/bionic
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-15T04:43:00Z
Last change time
2015-06-09T01:31:23Z
Assigned to
nobody
Creator
code
Comments
Comment #0
by code — 2013-11-15T04:43:33Z
Druntime could easily implement it's own qsort.
https://github.com/ldc-developers/ldc/issues/490#issuecomment-28356710
Comment #1
by code — 2013-11-16T14:01:25Z
An existing (though copyrighted) implementation was removed with
https://github.com/D-Programming-Language/druntime/commit/45f1755cf13a1a376cc1572b5a9327d95fc0db75.
Also the used qsort_r isn't present in older glibc versions (see bug 10508).
Comment #2
by dbugz — 2014-01-05T02:54:17Z
There is a qsort in bionic, looks like it comes from FreeBSD:
https://github.com/android/platform_bionic/blob/master/libc/include/stdlib.h#L91
https://github.com/android/platform_bionic/blob/master/libc/upstream-freebsd/lib/libc/stdlib/qsort.c#L110
There is no qsort_r, which is what Druntime uses on linux by default: my guess is that's what Elvis tried to use. But you can use the fallback block from rt/qsort.d that calls qsort on Android and I believe it should work fine.