Fixing Android ArmV8/Clang/LibC++ build

This commit is contained in:
Bradley Austin Davis 2017-11-24 12:17:19 -08:00 committed by Brad Davis
parent 451b56f4c9
commit 0438f97edf
3 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,9 @@ void Options::SetVector(const std::string &name, const DataTypeT *vec,
for (int i = 0; i < num_dims; ++i) { for (int i = 0; i < num_dims; ++i) {
if (i > 0) if (i > 0)
out += " "; out += " ";
#ifdef ANDROID
// GNU STL on android doesn't include a proper std::to_string, but the libc++ version does
#if defined(ANDROID) && !defined(_LIBCPP_VERSION)
out += to_string(vec[i]); out += to_string(vec[i]);
#else #else
out += std::to_string(vec[i]); out += std::to_string(vec[i]);

View File

@ -53,7 +53,7 @@ bool ObjDecoder::DecodeFromFile(const std::string &file_name,
if (!file) if (!file)
return false; return false;
// Read the whole file into a buffer. // Read the whole file into a buffer.
int64_t file_size = file.tellg(); auto file_size = file.tellg();
file.seekg(0, std::ios::end); file.seekg(0, std::ios::end);
file_size = file.tellg() - file_size; file_size = file.tellg() - file_size;
if (file_size == 0) if (file_size == 0)

View File

@ -34,7 +34,7 @@ bool PlyDecoder::DecodeFromFile(const std::string &file_name,
if (!file) if (!file)
return false; return false;
// Read the whole file into a buffer. // Read the whole file into a buffer.
int64_t file_size = file.tellg(); auto file_size = file.tellg();
file.seekg(0, std::ios::end); file.seekg(0, std::ios::end);
file_size = file.tellg() - file_size; file_size = file.tellg() - file_size;
if (file_size == 0) if (file_size == 0)