summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-02-09 20:27:00 +0100
committerMax Kellermann <max@musicpd.org>2018-02-09 22:54:22 +0100
commit0f8d223c7fcc7e61808716dbb740786b9d95a991 (patch)
tree5913e9aa1e3a90aff0778bf32a6e83161fdf09c0 /src/util
parent19a2885fd5174f65a17ccb20d2fc790269baea02 (diff)
protocol/ArgParser: move strtof()/strtod() switch to util/NumberParser.hxx
Diffstat (limited to 'src/util')
-rw-r--r--src/util/NumberParser.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/NumberParser.hxx b/src/util/NumberParser.hxx
index 47e9aacbd..67d42affa 100644
--- a/src/util/NumberParser.hxx
+++ b/src/util/NumberParser.hxx
@@ -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