Commit 510b9e7a authored by SiZiOUS's avatar SiZiOUS

mruby-io: Fixing compilation issue under the legacy MinGW environment

Adding MRB_MINGW32_LEGACY in common.h in order to identify the legacy MinGW environment (i.e. NOT to be confused with MinGW-w64).
For more info about MinGW defined macros, see: https://sourceforge.net/p/predef/wiki/Compilers/
parent 564372d7
...@@ -82,6 +82,9 @@ MRB_BEGIN_DECL ...@@ -82,6 +82,9 @@ MRB_BEGIN_DECL
# elif defined(__MINGW32_MAJOR_VERSION) # elif defined(__MINGW32_MAJOR_VERSION)
# define MRB_MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 1000 + __MINGW32_MINOR_VERSION) # define MRB_MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 1000 + __MINGW32_MINOR_VERSION)
# endif # endif
# if defined(__MINGW32__) && !defined(__MINGW64__)
# define MRB_MINGW32_LEGACY
# endif
#endif #endif
MRB_END_DECL MRB_END_DECL
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
#define LOCK_UN 8 #define LOCK_UN 8
#endif #endif
#ifndef _WIN32 #if !defined(_WIN32) || defined(MRB_MINGW32_LEGACY)
typedef struct stat mrb_stat; typedef struct stat mrb_stat;
# define mrb_stat(path, sb) stat(path, sb) # define mrb_stat(path, sb) stat(path, sb)
# define mrb_fstat(fd, sb) fstat(fd, sb) # define mrb_fstat(fd, sb) fstat(fd, sb)
......
...@@ -33,9 +33,11 @@ ...@@ -33,9 +33,11 @@
typedef long fsuseconds_t; typedef long fsuseconds_t;
typedef int fmode_t; typedef int fmode_t;
typedef int mrb_io_read_write_size; typedef int mrb_io_read_write_size;
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && \ #ifndef MRB_MINGW32_LEGACY
!defined(__have_typedef_ssize_t) #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && \
typedef SSIZE_T ssize_t; !defined(__have_typedef_ssize_t)
typedef SSIZE_T ssize_t;
#endif
#endif #endif
#ifndef O_TMPFILE #ifndef O_TMPFILE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment