fix issues that nuwen/TDM MinGW distro

This commit is contained in:
Jinhao 2017-07-08 04:22:26 +08:00
parent 50db6f81f0
commit d4fb5a226f
2 changed files with 18 additions and 27 deletions

View File

@ -150,11 +150,7 @@
#if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1))
#define STD_THREAD_NOT_SUPPORTED
#endif
#if 0
#if (__GNUC_MINOR__ < 9)
#define _enable_std_make_unique
#endif
#endif
#if defined(NANA_MINGW)
#ifndef __MINGW64_VERSION_MAJOR
//It's a knonwn issue under MinGW(except MinGW-W64)
@ -183,30 +179,23 @@
# endif
#endif
#include <iosfwd>
//Detects std::make_unique
#if (!defined(_MSC_VER)) && (__cplusplus >= 201300)
# if !defined(__cpp_lib_make_unique) || (__cpp_lib_make_unique != 201304)
# ifndef _enable_std_make_unique
//Detects the feature std::make_unique
//std::make_unique has been provided by Visual C++ 2013 and later
#undef _enable_std_make_unique
#if (defined(__clang__) && (__cplusplus < 201305L || (__cplusplus == 201305L && (__clang_major__ * 100 + __clang_minor__ < 304 )))) \
|| ((!defined(__clang__)) && defined(__GNUC__) && __cplusplus < 201300L)
# define _enable_std_make_unique
# endif
# endif
#endif
//Detects the feature std::clamp
//Visual C++ 2017 with /std:c++latest provides the std::clamp
#if !defined(_MSVC_LANG) || (_MSVC_LANG < 201403L)
// std::clamp's feature test macro is defined inside <algorithm>
// But nana still avoids introducing <algorithm> on MSVC.
# ifndef _MSC_VER
# include <algorithm>
# endif
# if ((!defined(__cpp_lib_clamp)) || (__cpp_lib_clamp < 201603)) && (!defined(_enable_std_clamp))
#undef _enable_std_clamp
#if (defined(_MSC_VER) && ((!defined(_MSVC_LANG)) || _MSVC_LANG < 201403L)) \
|| (defined(__clang__) && (__cplusplus < 201406L)) \
|| (defined(__GNUC__) && (!defined(__clang__)) && (__cplusplus < 201703))
# define _enable_std_clamp
# endif
#endif

View File

@ -15,6 +15,8 @@
//Implement workarounds for GCC/MinGW which version is below 4.8.2
#if defined(STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED)
#include <sstream>
#include <cstdlib>
#include <stdexcept>
namespace std
{
int stoi(const std::string& str, std::size_t * pos, int base)