diff --git a/src/compat.h b/src/compat.h index 5aca6df..c5947ec 100644 --- a/src/compat.h +++ b/src/compat.h @@ -8,7 +8,11 @@ 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 __MINGW32__ +#include "sys/types.h" +#else +// MSVC Windows doesn't have ssize_t, so we define it here #ifdef _WIN32 #if SIZE_MAX == UINT_MAX typedef int ssize_t; /* common 32 bit case */ @@ -33,6 +37,7 @@ typedef intmax_t ssize_t; /* last resort, chux suggestion */ #else #error platform has exotic SIZE_MAX #endif -#endif +#endif // _WIN32 +#endif // _MINGW32 #endif