aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compat.h14
1 files 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 @@
8void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup); 8void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup);
9#endif 9#endif
10 10
11// Windows doesn't have ssize_t, so we define it here 11
12#ifdef _WIN32 12#ifdef __MINGW32__
13#include <sys/types.h>
14#endif
15
16#ifdef _MSC_VER
17// MSVC Windows doesn't have ssize_t, so we define it here
13#if SIZE_MAX == UINT_MAX 18#if SIZE_MAX == UINT_MAX
14typedef int ssize_t; /* common 32 bit case */ 19typedef int ssize_t; /* common 32 bit case */
15#define SSIZE_MIN INT_MIN 20#define SSIZE_MIN INT_MIN
@@ -33,6 +38,7 @@ typedef intmax_t ssize_t; /* last resort, chux suggestion */
33#else 38#else
34#error platform has exotic SIZE_MAX 39#error platform has exotic SIZE_MAX
35#endif 40#endif
36#endif
37 41
38#endif 42#endif // _MSC_VER
43
44#endif // COMPAT_H