[core] Use std::to_string on Windows
Clang on Window's can't parse rapidjson's dtoa.
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
3b49ec3a0b
commit
0d7d3d8959
@@ -1,10 +1,16 @@
|
||||
#include "dtoa.hpp"
|
||||
|
||||
// Clang/C2 on Windows 64-bits can't parse rapidjson's dtoa
|
||||
// and it was causing the compiler to crash.
|
||||
#if !defined(_WINDOWS)
|
||||
#include <rapidjson/internal/dtoa.h>
|
||||
#endif
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
#if !defined(_WINDOWS)
|
||||
|
||||
namespace {
|
||||
|
||||
// From https://github.com/miloyip/rapidjson/blob/master/include/rapidjson/internal/dtoa.h
|
||||
@@ -101,5 +107,13 @@ std::string dtoa(double value) {
|
||||
return data;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
std::string dtoa(double value) {
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace util
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
char* dtoa(double value, char* buffer);
|
||||
std::string dtoa(double value);
|
||||
|
||||
} // end namespace util
|
||||
|
||||
Reference in New Issue
Block a user