Skip to content

Commit

Permalink
fix(mingw): fix the windows build with MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Nov 16, 2023
1 parent 1c73db8 commit c246650
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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

0 comments on commit c246650

Please sign in to comment.