qsort_r is not completely standardized, so we must accomodate for different platforms. The qsort_s function is available on Windows and we can use macros to transparently change behavior when required.