protocol/ArgParser: move strtof()/strtod() switch to util/NumberParser.hxx

This commit is contained in:
Max Kellermann
2018-02-09 20:27:00 +01:00
parent 19a2885fd5
commit 0f8d223c7f
2 changed files with 7 additions and 6 deletions

View File

@@ -78,7 +78,12 @@ ParseDouble(const char *p, char **endptr=nullptr)
static inline float
ParseFloat(const char *p, char **endptr=nullptr)
{
#if defined(__BIONIC__) && __ANDROID_API__ < 21
/* strtof() requires API level 21 */
return (float)ParseDouble(p, endptr);
#else
return strtof(p, endptr);
#endif
}
#endif