Apple's qsort implementation with support for inlined comparison (by macros)