1818# endif
1919# include <windows.h>
2020
21- # ifdef GIT_QSORT_S_MSC
21+ # ifdef GIT_QSORT_MSC
2222# include <search.h>
2323# endif
2424#endif
@@ -673,7 +673,7 @@ size_t git__unescape(char *str)
673673 return (pos - str );
674674}
675675
676- #if defined(GIT_QSORT_S_MSC ) || defined(GIT_QSORT_R_BSD )
676+ #if defined(GIT_QSORT_MSC ) || defined(GIT_QSORT_BSD )
677677typedef struct {
678678 git__sort_r_cmp cmp ;
679679 void * payload ;
@@ -688,10 +688,11 @@ static int GIT_LIBGIT2_CALL git__qsort_r_glue_cmp(
688688#endif
689689
690690
691- #if !defined(GIT_QSORT_R_BSD ) && \
692- !defined(GIT_QSORT_R_GNU ) && \
693- !defined(GIT_QSORT_S_C11 ) && \
694- !defined(GIT_QSORT_S_MSC )
691+ #if !defined(GIT_QSORT_BSD ) && \
692+ !defined(GIT_QSORT_GNU ) && \
693+ !defined(GIT_QSORT_C11 ) && \
694+ !defined(GIT_QSORT_MSC )
695+
695696static void swap (uint8_t * a , uint8_t * b , size_t elsize )
696697{
697698 char tmp [256 ];
@@ -717,19 +718,20 @@ static void insertsort(
717718 for (j = i ; j > base && cmp (j , j - elsize , payload ) < 0 ; j -= elsize )
718719 swap (j , j - elsize , elsize );
719720}
721+
720722#endif
721723
722724void git__qsort_r (
723725 void * els , size_t nel , size_t elsize , git__sort_r_cmp cmp , void * payload )
724726{
725- #if defined(GIT_QSORT_R_GNU )
727+ #if defined(GIT_QSORT_GNU )
726728 qsort_r (els , nel , elsize , cmp , payload );
727- #elif defined(GIT_QSORT_S_C11 )
729+ #elif defined(GIT_QSORT_C11 )
728730 qsort_s (els , nel , elsize , cmp , payload );
729- #elif defined(GIT_QSORT_R_BSD )
731+ #elif defined(GIT_QSORT_BSD )
730732 git__qsort_r_glue glue = { cmp , payload };
731733 qsort_r (els , nel , elsize , & glue , git__qsort_r_glue_cmp );
732- #elif defined(GIT_QSORT_S_MSC )
734+ #elif defined(GIT_QSORT_MSC )
733735 git__qsort_r_glue glue = { cmp , payload };
734736 qsort_s (els , nel , elsize , git__qsort_r_glue_cmp , & glue );
735737#else
0 commit comments