libgit2/libgit2 — pull request #1609 by ethomson (2013-05-25 16:43:55+00:00)
Title: qsort_r appeared in glibc 2.8

Fall back to insert sort on ancient versions of glibc. Tested on glibc 2.3.6 (Ubuntu 6.0.6).

This is in response to https://github.com/libgit2/libgit2/issues/1606 and similar to @arrbee's proposal therein except that we check for `__GLIBC__ == 2` in case glibc revs to 3.0.

(I don't think this will cause problems against people building and having `__GLIBC__ == 1`, because I don't think that's a thing, but if it is we can sort it out when somebody does that, which is to say never.)