diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-29 23:04:02 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-08-29 23:04:02 +0900 |
| commit | 705f95c983b7877113d9165b44e9f07cedd5fb36 (patch) | |
| tree | d7a4d6ae4f872d1d74f20fb02478b9948d4196e1 | |
| parent | 6b8664b951af9b8734d5127bd8a746a67fde283c (diff) | |
| parent | 510b9e7abc33843d3fae2a4d7cf0b1213bb352cc (diff) | |
| download | mruby-705f95c983b7877113d9165b44e9f07cedd5fb36.tar.gz mruby-705f95c983b7877113d9165b44e9f07cedd5fb36.zip | |
Merge pull request #5068 from sizious/mingw32-legacy-fixes
mruby-io: Fixing compilation issue under the legacy MinGW environment
| -rw-r--r-- | include/mruby/common.h | 3 | ||||
| -rw-r--r-- | mrbgems/mruby-io/src/file.c | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-io/src/io.c | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/include/mruby/common.h b/include/mruby/common.h index f704ef8df..1f91c5607 100644 --- a/include/mruby/common.h +++ b/include/mruby/common.h @@ -82,6 +82,9 @@ MRB_BEGIN_DECL # elif defined(__MINGW32_MAJOR_VERSION) # define MRB_MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 1000 + __MINGW32_MINOR_VERSION) # endif +# if defined(__MINGW32__) && !defined(__MINGW64__) +# define MRB_MINGW32_LEGACY +# endif #endif MRB_END_DECL diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index ffc66ae91..d3c4b3885 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -66,7 +66,7 @@ #define LOCK_UN 8 #endif -#ifndef _WIN32 +#if !defined(_WIN32) || defined(MRB_MINGW32_LEGACY) typedef struct stat mrb_stat; # define mrb_stat(path, sb) stat(path, sb) # define mrb_fstat(fd, sb) fstat(fd, sb) diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c index b3e192899..2c9cba84a 100644 --- a/mrbgems/mruby-io/src/io.c +++ b/mrbgems/mruby-io/src/io.c @@ -33,9 +33,11 @@ typedef long fsuseconds_t; typedef int fmode_t; typedef int mrb_io_read_write_size; - #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && \ - !defined(__have_typedef_ssize_t) - typedef SSIZE_T ssize_t; + #ifndef MRB_MINGW32_LEGACY + #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) && \ + !defined(__have_typedef_ssize_t) + typedef SSIZE_T ssize_t; + #endif #endif #ifndef O_TMPFILE |
