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:
parent
375a4af478
commit
acb2de0554
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue