From 8020374d6b8b5d2d31acc0dfec8c2273b6d22e76 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sat, 1 Feb 2020 15:58:32 +0900 Subject: Fix builds for old mingw in mruby-socket; ref #4914 --- include/mruby/common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') 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 */ -- cgit v1.2.3