1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

cannot compile this code ( http://melpon.org/wandbox/permlink/dMPGXatLnTh3o3Fk ) by my environment

This commit is contained in:
minamiyama1994 2014-02-23 19:37:56 +09:00
parent 274122efb2
commit 0009f778e6
2 changed files with 16 additions and 0 deletions

View file

@ -241,9 +241,17 @@ namespace sprout {
inline SPROUT_CONSTEXPR FloatType
str_to_float(CStrIterator str, CharPtr* endptr) {
return !endptr ? sprout::detail::str_to_float<FloatType>(str)
#ifdef __MINGW32__
: std::is_same<typename std::remove_cv<FloatType>::type, float>::value ? strtof(&*str, endptr)
#else
: std::is_same<typename std::remove_cv<FloatType>::type, float>::value ? std::strtof(&*str, endptr)
#endif
: std::is_same<typename std::remove_cv<FloatType>::type, double>::value ? std::strtod(&*str, endptr)
#ifdef __MINGW32__
: strtold(&*str, endptr)
#else
: std::strtold(&*str, endptr)
#endif
;
}
} // namespace detail

View file

@ -109,10 +109,18 @@ namespace sprout {
return !endptr ? sprout::detail::str_to_int<IntType>(str, base)
: std::is_signed<IntType>::value
? sizeof(IntType) <= sizeof(long) ? static_cast<IntType>(std::strtol(&*str, endptr, base))
#ifdef __MINGW32__
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(strtoll(&*str, endptr, base))
#else
: sizeof(IntType) <= sizeof(long long) ? static_cast<IntType>(std::strtoll(&*str, endptr, base))
#endif
: static_cast<IntType>(std::strtoimax(&*str, endptr, base))
: sizeof(IntType) <= sizeof(unsigned long) ? static_cast<IntType>(std::strtoul(&*str, endptr, base))
#ifdef __MINGW32__
: sizeof(IntType) <= sizeof(unsigned long long) ? static_cast<IntType>(strtoull(&*str, endptr, base))
#else
: sizeof(IntType) <= sizeof(unsigned long long) ? static_cast<IntType>(std::strtoull(&*str, endptr, base))
#endif
: static_cast<IntType>(std::strtoumax(&*str, endptr, base))
;
#endif