Commit ec17d54a by Nico Weber

Fix angle miscompiling shaders on x86_64 Android.

BUG=487341 Change-Id: I792e0c9419566facb0bec0ad93f3646294e5a2a7 Reviewed-on: https://chromium-review.googlesource.com/293500Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarNico Weber <thakis@chromium.org> Reviewed-by: 's avatarNico Weber <thakis@chromium.org>
parent 217fe6ec
...@@ -48,6 +48,15 @@ bool numeric_lex_int(const std::string &str, IntType *value) ...@@ -48,6 +48,15 @@ bool numeric_lex_int(const std::string &str, IntType *value)
template<typename FloatType> template<typename FloatType>
bool numeric_lex_float(const std::string &str, FloatType *value) bool numeric_lex_float(const std::string &str, FloatType *value)
{ {
// On 64-bit Intel Android, istringstream is broken. Until this is fixed in
// a newer NDK, don't use it. Android doesn't have locale support, so this
// doesn't have to force the C locale.
// TODO(thakis): Remove this once this bug has been fixed in the NDK and
// that NDK has been rolled into chromium.
#if defined(ANGLE_PLATFORM_ANDROID) && __x86_64__
*value = strtod(str.c_str(), nullptr);
return errno != ERANGE;
#else
std::istringstream stream(str); std::istringstream stream(str);
// Force "C" locale so that decimal character is always '.', and // Force "C" locale so that decimal character is always '.', and
// not dependent on the current locale. // not dependent on the current locale.
...@@ -55,6 +64,7 @@ bool numeric_lex_float(const std::string &str, FloatType *value) ...@@ -55,6 +64,7 @@ bool numeric_lex_float(const std::string &str, FloatType *value)
stream >> (*value); stream >> (*value);
return !stream.fail(); return !stream.fail();
#endif
} }
} // namespace pp. } // namespace pp.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment