From e2b450de2421c62dbafe567345ac47fa3c606798 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Fri, 15 Dec 2023 12:24:04 +0100 Subject: fix(mingw): fix the windows build with MinGW (#10) --- src/compat.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/compat.h b/src/compat.h index 5aca6df..35f9ef2 100644 --- a/src/compat.h +++ b/src/compat.h @@ -8,8 +8,13 @@ void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup); #endif -// Windows doesn't have ssize_t, so we define it here -#ifdef _WIN32 + +#ifdef __MINGW32__ +#include +#endif + +#ifdef _MSC_VER +// MSVC Windows doesn't have ssize_t, so we define it here #if SIZE_MAX == UINT_MAX typedef int ssize_t; /* common 32 bit case */ #define SSIZE_MIN INT_MIN @@ -33,6 +38,7 @@ typedef intmax_t ssize_t; /* last resort, chux suggestion */ #else #error platform has exotic SIZE_MAX #endif -#endif -#endif +#endif // _MSC_VER + +#endif // COMPAT_H -- cgit v1.2.3-55-g6feb