File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737#include " SmartPtrs.h"
3838#include " Exception.h"
3939#include < charconv>
40+ #include < cerrno>
41+ #include < cstdlib>
4042#include < limits>
4143#include < memory>
4244#include < optional>
@@ -1129,9 +1131,18 @@ namespace fbcpp
11291131 case DescriptorAdjustedType::DOUBLE :
11301132 {
11311133 double doubleValue;
1134+ #if defined(__APPLE__)
1135+ errno = 0 ;
1136+ std::string valueString{value};
1137+ char * parseEnd = nullptr ;
1138+ doubleValue = std::strtod (valueString.c_str (), &parseEnd);
1139+ if (parseEnd != valueString.c_str () + valueString.size () || errno == ERANGE )
1140+ numericConverter.throwConversionErrorFromString (std::move (valueString));
1141+ #else
11321142 const auto convResult = std::from_chars (value.data (), value.data () + value.size (), doubleValue);
11331143 if (convResult.ec != std::errc{} || convResult.ptr != value.data () + value.size ())
11341144 numericConverter.throwConversionErrorFromString (std::string{value});
1145+ #endif
11351146 setDouble (index, doubleValue);
11361147 return ;
11371148 }
You can’t perform that action at this time.
0 commit comments