summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-02-01 17:41:19 +0900
committerGitHub <[email protected]>2020-02-01 17:41:19 +0900
commit3c67d9b1c0e4970db1d88fccdf7f26c781aa2c5f (patch)
treedc387cc8c7aba2ca3ec9463de9b66df51bbc8a35 /include
parentdb64bd42d358425250d05b02a0880702da2cea87 (diff)
parent8020374d6b8b5d2d31acc0dfec8c2273b6d22e76 (diff)
downloadmruby-3c67d9b1c0e4970db1d88fccdf7f26c781aa2c5f.tar.gz
mruby-3c67d9b1c0e4970db1d88fccdf7f26c781aa2c5f.zip
Merge pull request #4938 from dearblue/socket-mingw
Fix builds for old mingw in mruby-socket; ref #4914
Diffstat (limited to 'include')
-rw-r--r--include/mruby/common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mruby/common.h b/include/mruby/common.h
index 5be9a40c6..f704ef8df 100644
--- a/include/mruby/common.h
+++ b/include/mruby/common.h
@@ -74,6 +74,16 @@ MRB_BEGIN_DECL
#endif
#endif
+/** Declare mingw versions */
+#if defined(__MINGW32__) || defined(__MINGW64__)
+# include <_mingw.h>
+# 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
+#endif
+
MRB_END_DECL
#endif /* MRUBY_COMMON_H */