mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 13:27:37 +00:00
use cdecl for hashsig sorting functions on Windows
This commit is contained in:
parent
e68e33f33d
commit
11b5beb7ba
@ -19,7 +19,14 @@ typedef uint64_t hashsig_state;
|
|||||||
|
|
||||||
#define HASHSIG_HEAP_SIZE ((1 << 7) - 1)
|
#define HASHSIG_HEAP_SIZE ((1 << 7) - 1)
|
||||||
|
|
||||||
typedef int (*hashsig_cmp)(const void *a, const void *b);
|
/* going to use qsort so jump through some Windows hoops */
|
||||||
|
#ifdef GIT_WIN32
|
||||||
|
#define GIT_CDECL __cdecl
|
||||||
|
#else
|
||||||
|
#define GIT_CDECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int (GIT_CDECL *hashsig_cmp)(const void *a, const void *b);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int size, asize;
|
int size, asize;
|
||||||
@ -53,13 +60,13 @@ static void hashsig_heap_init(hashsig_heap *h, hashsig_cmp cmp)
|
|||||||
h->cmp = cmp;
|
h->cmp = cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hashsig_cmp_max(const void *a, const void *b)
|
static int GIT_CDECL hashsig_cmp_max(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b;
|
hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b;
|
||||||
return (av < bv) ? -1 : (av > bv) ? 1 : 0;
|
return (av < bv) ? -1 : (av > bv) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hashsig_cmp_min(const void *a, const void *b)
|
static int GIT_CDECL hashsig_cmp_min(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b;
|
hashsig_t av = *(const hashsig_t *)a, bv = *(const hashsig_t *)b;
|
||||||
return (av > bv) ? -1 : (av < bv) ? 1 : 0;
|
return (av > bv) ? -1 : (av < bv) ? 1 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user