Merge branch 'master' into issue/1303

This commit is contained in:
Emma Broman
2020-10-09 15:41:47 +02:00
2 changed files with 11 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#include <openspace/properties/vector/vec2property.h>
#include <openspace/rendering/renderable.h>
#include <openspace/util/updatestructures.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/uniformcache.h>
namespace ghoul::filesystem { class File; }

View File

@@ -95,21 +95,31 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
LINFOC("CSVTOBIN", fmt::format("Loading {} stars", total));
auto readFloatData = [](const std::string& str) -> float {
#ifdef WIN32
float result;
auto [p, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
if (ec == std::errc()) {
return result;
}
return NAN;
#else
// clang is missing float support for std::from_chars
return !str.empty() ? std::stof(str.c_str(), nullptr) : NAN;
#endif
};
auto readDoubleData = [](const std::string& str) -> double {
#ifdef WIN32
double result;
auto [p, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
if (ec == std::errc()) {
return result;
}
return NAN;
#else
// clang is missing double support for std::from_chars
return !str.empty() ? std::stod(str.c_str(), nullptr) : NAN;
#endif
};
auto readIntegerData = [](const std::string& str) -> int {