Skip to content

Commit a82417d

Browse files
committed
Add override for strtof for android.
1 parent 95dc689 commit a82417d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

includes/sjson/parser.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ namespace sjson
6464
return ::strtoll(str, endptr, base);
6565
#else
6666
return std::strtoll(str, endptr, base);
67+
#endif
68+
}
69+
70+
inline float strtof(const char* str, char** endptr)
71+
{
72+
#if defined(__ANDROID__)
73+
return ::strtof(str, endptr);
74+
#else
75+
return std::strtof(str, endptr);
6776
#endif
6877
}
6978
}
@@ -749,7 +758,7 @@ namespace sjson
749758
if (dbl_value != nullptr)
750759
*dbl_value = std::strtod(slice, &last_used_symbol);
751760
else
752-
*flt_value = std::strtof(slice, &last_used_symbol);
761+
*flt_value = impl::strtof(slice, &last_used_symbol);
753762

754763
if (last_used_symbol != slice + length)
755764
{

0 commit comments

Comments
 (0)