fix std numeric conversions errors for GCC 5.1
This commit is contained in:
parent
2ac3b8128d
commit
1d9b75b1c2
@ -81,6 +81,7 @@
|
|||||||
#define STD_CODECVT_NOT_SUPPORTED
|
#define STD_CODECVT_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if (__GNUC__ == 4)
|
#if (__GNUC__ == 4)
|
||||||
#if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1))
|
#if ((__GNUC_MINOR__ < 8) || (__GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ < 1))
|
||||||
#define STD_THREAD_NOT_SUPPORTED
|
#define STD_THREAD_NOT_SUPPORTED
|
||||||
@ -90,15 +91,26 @@
|
|||||||
//boost.thread will be replaced with meganz's mingw-std-threads.
|
//boost.thread will be replaced with meganz's mingw-std-threads.
|
||||||
// https://github.com/meganz/mingw-std-threads
|
// https://github.com/meganz/mingw-std-threads
|
||||||
//#define USE_github_com_meganz_mingw_std_threads
|
//#define USE_github_com_meganz_mingw_std_threads
|
||||||
|
|
||||||
|
#define STD_TO_STRING_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//_GLIBCXX_HAVE_BROKEN_VSWPRINTF is enabled to turn off all numeric conversions on MinGW(GCC 4)
|
||||||
|
|
||||||
#if defined(NANA_MINGW)
|
#if defined(NANA_MINGW)
|
||||||
//It's a known issue under MinGW
|
//It's a knonwn issue under MinGW
|
||||||
#define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED
|
#define STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ((__GNUC_MINOR__ < 8) || defined(NANA_MINGW))
|
#if ((__GNUC_MINOR__ < 8) || defined(NANA_MINGW))
|
||||||
#define STD_TO_STRING_NOT_SUPPORTED
|
#define STD_TO_STRING_NOT_SUPPORTED
|
||||||
|
#define STD_TO_WSTRING_NOT_SUPPORTED
|
||||||
|
#endif
|
||||||
|
#elif (__GNUC__ == 5)
|
||||||
|
#if defined(NANA_MINGW)
|
||||||
|
//The _GLIBCXX_HAVE_BROKEN_VSWPRINTF only applies to wide string
|
||||||
|
//It's a knonwn issue under MinGW
|
||||||
|
#define STD_TO_WSTRING_NOT_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* The Deploy Implementation
|
* The Deploy Implementation
|
||||||
* Nana C++ Library(http://www.nanapro.org)
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
* Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com)
|
* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com)
|
||||||
*
|
*
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -72,7 +72,12 @@ namespace std
|
|||||||
std::string to_string(long long);
|
std::string to_string(long long);
|
||||||
std::string to_string(unsigned long long);
|
std::string to_string(unsigned long long);
|
||||||
std::string to_string(float);
|
std::string to_string(float);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef STD_TO_WSTRING_NOT_SUPPORTED
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
std::wstring to_wstring(long double);
|
std::wstring to_wstring(long double);
|
||||||
std::wstring to_wstring(double);
|
std::wstring to_wstring(double);
|
||||||
std::wstring to_wstring(unsigned);
|
std::wstring to_wstring(unsigned);
|
||||||
|
|||||||
@ -298,6 +298,7 @@ namespace std
|
|||||||
#endif //STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED
|
#endif //STD_NUMERIC_CONVERSIONS_NOT_SUPPORTED
|
||||||
|
|
||||||
#ifdef STD_TO_STRING_NOT_SUPPORTED
|
#ifdef STD_TO_STRING_NOT_SUPPORTED
|
||||||
|
#include <sstream>
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
std::string to_string(double v)
|
std::string to_string(double v)
|
||||||
@ -362,7 +363,13 @@ namespace std
|
|||||||
ss << v;
|
ss << v;
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif // STD_TO_STRING_NOT_SUPPORTED
|
||||||
|
|
||||||
|
#ifdef STD_TO_WSTRING_NOT_SUPPORTED
|
||||||
|
#include <sstream>
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
std::wstring to_wstring(double v)
|
std::wstring to_wstring(double v)
|
||||||
{
|
{
|
||||||
std::wstringstream ss;
|
std::wstringstream ss;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user