diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2023-12-15 12:24:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-15 12:24:04 +0100 |
commit | e2b450de2421c62dbafe567345ac47fa3c606798 (patch) | |
tree | e3a265e9ed936a3bcea68d11ffd139dd90e10db2 | |
parent | 1c73db8eb4c9c12b740de7c580b451f6561abc42 (diff) | |
download | luasystem-e2b450de2421c62dbafe567345ac47fa3c606798.tar.gz luasystem-e2b450de2421c62dbafe567345ac47fa3c606798.tar.bz2 luasystem-e2b450de2421c62dbafe567345ac47fa3c606798.zip |
fix(mingw): fix the windows build with MinGW (#10)
-rw-r--r-- | src/compat.h | 14 |
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 @@ | |||
8 | void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup); | 8 | void 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 |
14 | typedef int ssize_t; /* common 32 bit case */ | 19 | typedef 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 | ||