Try to fix build on Linux.

* Linux is the only one of our supported build hosts to not have
mergesort. Provide an implementation that calls qsort, since the qsort
implementation in the glibc used by Linux uses a mergesort (!) for small
arrays.
This commit is contained in:
Adrien Destugues
2014-05-02 13:56:00 +02:00
parent 3dfdd43723
commit 6df2ee73b3
+11
View File
@@ -69,3 +69,14 @@ snooze_until(bigtime_t time, int timeBase)
{
return snooze(time - system_time());
}
#ifdef __linux__
// Linux is the only system out there to not have this...
int mergesort(void* base, size_t count, size_t size,
int (*compare)(const void *, const void *))
{
qsort(base, count, size, compare);
return 0;
}
#endif