Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dpantele/d2e2aec8ff23b0208245c8a6e882f7fe to your computer and use it in GitHub Desktop.
Save dpantele/d2e2aec8ff23b0208245c8a6e882f7fe to your computer and use it in GitHub Desktop.
Possible android fix
From 5eb22b63fcdefdffb56a197c6c4a336e360e8561 Mon Sep 17 00:00:00 2001
From: Dmitry Panteleev <[email protected]>
Date: Mon, 16 May 2016 20:07:14 -0400
Subject: [PATCH] Some fix for android arm build
---
fmt/format.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fmt/format.h b/fmt/format.h
index 5013b81..cdf3f6b 100644
--- a/fmt/format.h
+++ b/fmt/format.h
@@ -34,6 +34,7 @@
#include <cstdio>
#include <cstring>
#include <limits>
+#include <locale>
#include <memory>
#include <stdexcept>
#include <string>
@@ -2753,7 +2754,8 @@ void BasicWriter<Char>::write_int(T value, Spec spec) {
}
case 'n': {
unsigned num_digits = internal::count_digits(abs_value);
- fmt::StringRef sep = std::localeconv()->thousands_sep;
+ char sep_char = std::use_facet<std::numpunct<char> >(std::locale(std::setlocale(LC_ALL, NULL))).thousands_sep();
+ fmt::StringRef sep(&char_sep, 1);
unsigned size = static_cast<unsigned>(
num_digits + sep.size() * (num_digits - 1) / 3);
CharPtr p = prepare_int_buffer(size, spec, prefix, prefix_size) + 1;
--
2.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment