From 1b78459d2812bfe9f9bbb886e581904f3a740466 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 30 Sep 2024 17:57:52 -0700
Subject: [PATCH] Define STBRP__CDECL as SDLCALL
---
src/SDL_renderer_textengine.c | 1 +
src/stb_rect_pack.h | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/SDL_renderer_textengine.c b/src/SDL_renderer_textengine.c
index 3c1947c7..a367a1d7 100644
--- a/src/SDL_renderer_textengine.c
+++ b/src/SDL_renderer_textengine.c
@@ -28,6 +28,7 @@
#define STBRP_STATIC
#define STBRP_SORT SDL_qsort
#define STBRP_ASSERT SDL_assert
+#define STBRP__CDECL SDLCALL
#include "stb_rect_pack.h"
typedef struct AtlasGlyph AtlasGlyph;
diff --git a/src/stb_rect_pack.h b/src/stb_rect_pack.h
index 6a633ce6..099b1322 100644
--- a/src/stb_rect_pack.h
+++ b/src/stb_rect_pack.h
@@ -215,11 +215,16 @@ struct stbrp_context
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
-#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
+#endif
+#ifndef STBRP__CDECL
+#ifdef _MSC_VER
+#define STBRP__CDECL __cdecl
+#else
#define STBRP__CDECL
#endif
+#endif /* STBRP__CDECL */
enum
{