From 818ac26785a77cd011403a21eeedc5725abdd591 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 9 Jul 2021 13:17:06 +0200 Subject: [PATCH] stb_rect_pack: making functions cdecl for msvc qsort --- stb_rect_pack.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stb_rect_pack.h b/stb_rect_pack.h index 48362eb..a0667a1 100644 --- a/stb_rect_pack.h +++ b/stb_rect_pack.h @@ -215,8 +215,10 @@ struct stbrp_context #ifdef _MSC_VER #define STBRP__NOTUSED(v) (void)(v) +#define STBRP__CDECL __cdecl #else #define STBRP__NOTUSED(v) (void)sizeof(v) +#define STBRP__CDECL #endif enum @@ -519,7 +521,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i return res; } -static int rect_height_compare(const void *a, const void *b) +static int STBRP__CDECL rect_height_compare(const void *a, const void *b) { const stbrp_rect *p = (const stbrp_rect *) a; const stbrp_rect *q = (const stbrp_rect *) b; @@ -530,7 +532,7 @@ static int rect_height_compare(const void *a, const void *b) return (p->w > q->w) ? -1 : (p->w < q->w); } -static int rect_original_order(const void *a, const void *b) +static int STBRP__CDECL rect_original_order(const void *a, const void *b) { const stbrp_rect *p = (const stbrp_rect *) a; const stbrp_rect *q = (const stbrp_rect *) b;