From 7c17b932e4ac9d33272c91cfb45d7cff994f0c32 Mon Sep 17 00:00:00 2001 From: "James E. King, III" Date: Mon, 16 Oct 2017 19:41:33 -0400 Subject: [PATCH] detect mingw32 and mingw64 as separate entities (#61) --- include/boost/predef/platform.h | 2 + include/boost/predef/platform/mingw.h | 4 +- include/boost/predef/platform/mingw32.h | 63 +++++++++++++++++++++++++ include/boost/predef/platform/mingw64.h | 63 +++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 include/boost/predef/platform/mingw32.h create mode 100644 include/boost/predef/platform/mingw64.h diff --git a/include/boost/predef/platform.h b/include/boost/predef/platform.h index 483aeb6..86ca707 100644 --- a/include/boost/predef/platform.h +++ b/include/boost/predef/platform.h @@ -12,6 +12,8 @@ http://www.boost.org/LICENSE_1_0.txt) #endif #include +#include +#include #include #include #include diff --git a/include/boost/predef/platform/mingw.h b/include/boost/predef/platform/mingw.h index 5a1334b..c52827d 100644 --- a/include/boost/predef/platform/mingw.h +++ b/include/boost/predef/platform/mingw.h @@ -14,7 +14,7 @@ http://www.boost.org/LICENSE_1_0.txt) /*` [heading `BOOST_PLAT_MINGW`] -[@http://en.wikipedia.org/wiki/MinGW MinGW] platform. +[@http://en.wikipedia.org/wiki/MinGW MinGW] platform, either variety. Version number available as major, minor, and patch. [table @@ -56,7 +56,7 @@ Version number available as major, minor, and patch. # include #endif -#define BOOST_PLAT_MINGW_NAME "MinGW" +#define BOOST_PLAT_MINGW_NAME "MinGW (any variety)" #endif diff --git a/include/boost/predef/platform/mingw32.h b/include/boost/predef/platform/mingw32.h new file mode 100644 index 0000000..ff90038 --- /dev/null +++ b/include/boost/predef/platform/mingw32.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_MINGW32_H +#define BOOST_PREDEF_PLAT_MINGW32_H + +#include +#include + +/*` +[heading `BOOST_PLAT_MINGW32`] + +[@http://www.mingw.org/ MinGW] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW32__`] [__predef_detection__]] + + [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define BOOST_PLAT_MINGW32 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW32__) +# include <_mingw.h> +# if !defined(BOOST_PLAT_MINGW32_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR)) +# define BOOST_PLAT_MINGW32_DETECTION \ + BOOST_VERSION_NUMBER(__MINGW32_VERSION_MAJOR,__MINGW32_VERSION_MINOR,0) +# endif +# if !defined(BOOST_PLAT_MINGW32_DETECTION) +# define BOOST_PLAT_MINGW32_DETECTION BOOST_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef BOOST_PLAT_MINGW32_DETECTION +# define BOOST_PLAT_MINGW32_AVAILABLE +# if defined(BOOST_PREDEF_DETAIL_PLAT_DETECTED) +# define BOOST_PLAT_MINGW32_EMULATED BOOST_PLAT_MINGW32_DETECTION +# else +# undef BOOST_PLAT_MINGW32 +# define BOOST_PLAT_MINGW32 BOOST_PLAT_MINGW32_DETECTION +# endif +# include +#endif + +#define BOOST_PLAT_MINGW32_NAME "MinGW" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW32,BOOST_PLAT_MINGW32_NAME) + +#ifdef BOOST_PLAT_MINGW32_EMULATED +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW32_EMULATED,BOOST_PLAT_MINGW32_NAME) +#endif diff --git a/include/boost/predef/platform/mingw64.h b/include/boost/predef/platform/mingw64.h new file mode 100644 index 0000000..a35dd3e --- /dev/null +++ b/include/boost/predef/platform/mingw64.h @@ -0,0 +1,63 @@ +/* +Copyright Rene Rivera 2008-2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +#ifndef BOOST_PREDEF_PLAT_MINGW64_H +#define BOOST_PREDEF_PLAT_MINGW64_H + +#include +#include + +/*` +[heading `BOOST_PLAT_MINGW64`] + +[@https://mingw-w64.org/ MinGW-w64] platform. +Version number available as major, minor, and patch. + +[table + [[__predef_symbol__] [__predef_version__]] + + [[`__MINGW64__`] [__predef_detection__]] + + [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]] + ] + */ + +#define BOOST_PLAT_MINGW64 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__MINGW64__) +# include <_mingw.h> +# if !defined(BOOST_PLAT_MINGW64_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR)) +# define BOOST_PLAT_MINGW64_DETECTION \ + BOOST_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0) +# endif +# if !defined(BOOST_PLAT_MINGW64_DETECTION) +# define BOOST_PLAT_MINGW64_DETECTION BOOST_VERSION_NUMBER_AVAILABLE +# endif +#endif + +#ifdef BOOST_PLAT_MINGW64_DETECTION +# define BOOST_PLAT_MINGW64_AVAILABLE +# if defined(BOOST_PREDEF_DETAIL_PLAT_DETECTED) +# define BOOST_PLAT_MINGW64_EMULATED BOOST_PLAT_MINGW64_DETECTION +# else +# undef BOOST_PLAT_MINGW64 +# define BOOST_PLAT_MINGW64 BOOST_PLAT_MINGW64_DETECTION +# endif +# include +#endif + +#define BOOST_PLAT_MINGW64_NAME "MinGW-w64" + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW64,BOOST_PLAT_MINGW64_NAME) + +#ifdef BOOST_PLAT_MINGW64_EMULATED +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_MINGW64_EMULATED,BOOST_PLAT_MINGW64_NAME) +#endif