[0.4.9] cherry-pick [CRT] Reimplement qsort() using FreeBSD implementation.
authorPierre Schweitzer <pierre@reactos.org>
Sat, 2 Jun 2018 11:52:09 +0000 (13:52 +0200)
committerJoachim Henze <Joachim.Henze@reactos.org>
Sun, 3 Jun 2018 12:37:28 +0000 (14:37 +0200)
commit7b3affa096e4a09c00e6c9cc376ce2b208607179
tree1f6dc96bbd95ce5300a6c36c125b3552cc391d59
parentb2a415edc2626dcec46a1af1bc23ab50fa581ee7
[0.4.9] cherry-pick [CRT] Reimplement qsort() using FreeBSD implementation.

Our implementation had a bug that could be triggered while
building our USBD library on ReactOS: the compare function
could be called with a NULL pointer instead of a valid value.

With this bug fixed (and the cmd hack in CORE-14648), ReactOS
can totally selfhost :-)! I was able to build LiveCD and BootCD
without any trouble, crash, deadlock or whatever.
(Next step: having a buildbot slave hosted on ReactOS ;-)).

Enjoy: https://twitter.com/HeisSpiter/status/1002880397103988737

CORE-14680

(cherry picked from commit 2dfe5e3f463ca4d7eb920d25c2a33b29a70f3e27)
sdk/lib/crt/stdlib/qsort.c