summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-12-31 09:42:47 +0900
committerGitHub <[email protected]>2019-12-31 09:42:47 +0900
commit83e502b847ee180cda59984ed004f0375b2cd1ef (patch)
tree6d1f03820bc599fc79b61cf054655163c9c0b0e2
parent5e519cdbb5410ae0919cf6458cff392d7f019511 (diff)
parent93d0e5d9fbfb81e5cb39a707ec633f80374b85ad (diff)
downloadmruby-83e502b847ee180cda59984ed004f0375b2cd1ef.tar.gz
mruby-83e502b847ee180cda59984ed004f0375b2cd1ef.zip
Merge pull request #4914 from dearblue/fix-4869
Fix builds for modern mingw; fix #4869
-rw-r--r--mrbgems/mruby-io/test/mruby_io_test.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mrbgems/mruby-io/test/mruby_io_test.c b/mrbgems/mruby-io/test/mruby_io_test.c
index 1c31c5fe0..3cf1c6111 100644
--- a/mrbgems/mruby-io/test/mruby_io_test.c
+++ b/mrbgems/mruby-io/test/mruby_io_test.c
@@ -18,7 +18,15 @@ typedef int mode_t;
#define open _open
#define close _close
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(__MINGW64_VERSION_MAJOR)
+# define MRB_MINGW64_VERSION (__MINGW64_VERSION_MAJOR * 1000 + __MINGW64_VERSION_MINOR)
+#elif defined(__MINGW32_MAJOR_VERSION)
+# define MRB_MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 1000 + __MINGW32_MINOR_VERSION)
+#endif
+
+#if defined(_MSC_VER) || \
+ (defined(MRB_MINGW32_VERSION) && MRB_MINGW32_VERSION < 3021) || \
+ (defined(MRB_MINGW64_VERSION) && MRB_MINGW64_VERSION < 4000)
#include <sys/stat.h>
static int