Fix issue with clang and older gcc

Not all compilers support c++17 yet so we can't use the floating point
version of from_chars

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15633
This commit is contained in:
Seth Hillbrand 2023-09-13 07:27:53 -07:00
parent 375a4af478
commit acb2de0554
1 changed files with 3 additions and 15 deletions

View File

@ -409,12 +409,8 @@ bool EXCELLON_IMAGE::TestFileIsExcellon( const wxString& aFullFileName )
else
{
double x_val;
char* start = letter + 1;
char* end = letter + strlen( letter );
std::from_chars_result res = std::from_chars( start, end, x_val );
if( res.ec != std::errc::invalid_argument )
if( wxString( letter + 1 ).ToCDouble( &x_val ) )
foundT = true;
}
}
@ -423,24 +419,16 @@ bool EXCELLON_IMAGE::TestFileIsExcellon( const wxString& aFullFileName )
if( ( letter = strstr( line, "X" ) ) != nullptr )
{
double x_val;
char* start = letter + 1;
char* end = letter + strlen( letter );
std::from_chars_result res = std::from_chars( start, end, x_val );
if( res.ec != std::errc::invalid_argument )
if( wxString( letter + 1 ).ToCDouble( &x_val ) )
foundX = true;
}
if( ( letter = strstr( line, "Y" ) ) != nullptr )
{
double x_val;
char* start = letter + 1;
char* end = letter + strlen( letter );
std::from_chars_result res = std::from_chars( start, end, x_val );
if( res.ec != std::errc::invalid_argument )
if( wxString( letter + 1 ).ToCDouble( &x_val ) )
foundY = true;
}
}