mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-07 19:57:43 +02:00
Fix compilation error on Android NDK level < 21
This commit is contained in:
parent
8ce34f818a
commit
e9d8f08561
2 changed files with 15 additions and 2 deletions
|
@ -1948,7 +1948,7 @@ class lexer
|
||||||
/// return the locale-dependent decimal point
|
/// return the locale-dependent decimal point
|
||||||
static char get_decimal_point() noexcept
|
static char get_decimal_point() noexcept
|
||||||
{
|
{
|
||||||
const auto loc = localeconv();
|
const auto loc = cpt::localeconv();
|
||||||
assert(loc != nullptr);
|
assert(loc != nullptr);
|
||||||
return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point);
|
return (loc->decimal_point == nullptr) ? '.' : *(loc->decimal_point);
|
||||||
}
|
}
|
||||||
|
@ -8247,7 +8247,7 @@ class serializer
|
||||||
@param[in] ichar indentation character to use
|
@param[in] ichar indentation character to use
|
||||||
*/
|
*/
|
||||||
serializer(output_adapter_t<char> s, const char ichar)
|
serializer(output_adapter_t<char> s, const char ichar)
|
||||||
: o(std::move(s)), loc(std::localeconv()),
|
: o(std::move(s)), loc(cpt::localeconv()),
|
||||||
thousands_sep(loc->thousands_sep == nullptr ? '\0' : * (loc->thousands_sep)),
|
thousands_sep(loc->thousands_sep == nullptr ? '\0' : * (loc->thousands_sep)),
|
||||||
decimal_point(loc->decimal_point == nullptr ? '\0' : * (loc->decimal_point)),
|
decimal_point(loc->decimal_point == nullptr ? '\0' : * (loc->decimal_point)),
|
||||||
indent_char(ichar), indent_string(512, indent_char)
|
indent_char(ichar), indent_string(512, indent_char)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <clocale>
|
||||||
|
|
||||||
#ifdef NO_CPP11_STRING
|
#ifdef NO_CPP11_STRING
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -16,6 +17,18 @@
|
||||||
|
|
||||||
namespace cpt
|
namespace cpt
|
||||||
{
|
{
|
||||||
|
static struct lconv* localeconv()
|
||||||
|
{
|
||||||
|
#ifdef NO_CPP11_STRING
|
||||||
|
static struct lconv result;
|
||||||
|
result.decimal_point = nullptr;
|
||||||
|
result.thousands_sep = nullptr;
|
||||||
|
return &result;
|
||||||
|
#else
|
||||||
|
return std::localeconv();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static std::string to_string(const T& t)
|
static std::string to_string(const T& t)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue