protocol/ArgParser: use strtod() instead of strtof() on Android
For Android pre-5.0 compatibility (#213).
This commit is contained in:
parent
b8a094470b
commit
19a2885fd5
@ -151,7 +151,12 @@ float
|
||||
ParseCommandArgFloat(const char *s)
|
||||
{
|
||||
char *endptr;
|
||||
#ifdef ANDROID
|
||||
/* strtof() requires API level 21 */
|
||||
auto value = strtod(s, &endptr);
|
||||
#else
|
||||
auto value = strtof(s, &endptr);
|
||||
#endif
|
||||
if (endptr == s || *endptr != 0)
|
||||
throw FormatProtocolError(ACK_ERROR_ARG,
|
||||
"Float expected: %s", s);
|
||||
|
Loading…
Reference in New Issue
Block a user