Replace __WXDEBUG__ (improperly used) by DEBUG in some #define.

__WXDEBUG__ comes from a build option of wxWidgets,
and is not related to a Debug versus Release Kicad build.
This commit is contained in:
jean-pierre charras 2019-10-14 10:58:46 +02:00
parent e291576c38
commit d77ba30a95
3 changed files with 56 additions and 56 deletions

View File

@ -102,10 +102,10 @@ unsigned int CAIRO_COMPOSITOR::CreateBuffer()
CAIRO_FORMAT_ARGB32, m_width, CAIRO_FORMAT_ARGB32, m_width,
m_height, m_stride ); m_height, m_stride );
cairo_t* context = cairo_create( surface ); cairo_t* context = cairo_create( surface );
#ifdef __WXDEBUG__ #ifdef DEBUG
cairo_status_t status = cairo_status( context ); cairo_status_t status = cairo_status( context );
wxASSERT_MSG( status == CAIRO_STATUS_SUCCESS, wxT( "Cairo context creation error" ) ); wxASSERT_MSG( status == CAIRO_STATUS_SUCCESS, wxT( "Cairo context creation error" ) );
#endif /* __WXDEBUG__ */ #endif /* DEBUG */
// Set default settings for the buffer // Set default settings for the buffer
cairo_set_antialias( context, m_currentAntialiasingMode ); cairo_set_antialias( context, m_currentAntialiasingMode );

View File

@ -1395,10 +1395,10 @@ void CAIRO_GAL::initSurface()
context = cairo_create( surface ); context = cairo_create( surface );
#ifdef __WXDEBUG__ #ifdef DEBUG
cairo_status_t status = cairo_status( context ); cairo_status_t status = cairo_status( context );
wxASSERT_MSG( status == CAIRO_STATUS_SUCCESS, wxT( "Cairo context creation error" ) ); wxASSERT_MSG( status == CAIRO_STATUS_SUCCESS, wxT( "Cairo context creation error" ) );
#endif /* __WXDEBUG__ */ #endif /* DEBUG */
currentContext = context; currentContext = context;
isInitialized = true; isInitialized = true;

View File

@ -164,9 +164,9 @@ FormatType fileType( const char* aFileName )
if( !lfile.FileExists() ) if( !lfile.FileExists() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * no such file: '" << aFileName << "'\n"; ostr << " * no such file: '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -257,9 +257,9 @@ bool PCBMODEL::AddOutlineSegment( KICADCURVE* aCurve )
if( distance < m_minDistance2 ) if( distance < m_minDistance2 )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * rejected a zero-length " << aCurve->Describe() << "\n"; ostr << " * rejected a zero-length " << aCurve->Describe() << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -276,9 +276,9 @@ bool PCBMODEL::AddOutlineSegment( KICADCURVE* aCurve )
if( rad < m_minDistance2 ) if( rad < m_minDistance2 )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * rejected a zero-radius " << aCurve->Describe() << "\n"; ostr << " * rejected a zero-radius " << aCurve->Describe() << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -316,9 +316,9 @@ bool PCBMODEL::AddOutlineSegment( KICADCURVE* aCurve )
if( rad < m_minDistance2 ) if( rad < m_minDistance2 )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * rejected an arc with equivalent end points, " ostr << " * rejected an arc with equivalent end points, "
<< aCurve->Describe() << "\n"; << aCurve->Describe() << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -422,9 +422,9 @@ bool PCBMODEL::AddOutlineSegment( KICADCURVE* aCurve )
do do
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * unsupported curve type: '" << aCurve->m_form << "'\n"; ostr << " * unsupported curve type: '" << aCurve->m_form << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
} while( 0 ); } while( 0 );
@ -585,9 +585,9 @@ bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string& aR
if( aFileName.empty() ) if( aFileName.empty() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * no model defined for component '" << aRefDes << "'\n"; ostr << " * no model defined for component '" << aRefDes << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -599,9 +599,9 @@ bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string& aR
if( !getModelLabel( aFileName, aScale, lmodel ) ) if( !getModelLabel( aFileName, aScale, lmodel ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * no model for filename '" << aFileName << "'\n"; ostr << " * no model for filename '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -613,9 +613,9 @@ bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string& aR
if( !getModelLocation( aBottom, aPosition, aRotation, aOffset, aOrientation, toploc ) ) if( !getModelLocation( aBottom, aPosition, aRotation, aOffset, aOrientation, toploc ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * no location data for filename '" << aFileName << "'\n"; ostr << " * no location data for filename '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -627,9 +627,9 @@ bool PCBMODEL::AddComponent( const std::string& aFileName, const std::string& aR
if( llabel.IsNull() ) if( llabel.IsNull() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not add component with filename '" << aFileName << "'\n"; ostr << " * could not add component with filename '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -671,9 +671,9 @@ bool PCBMODEL::CreatePCB()
{ {
m_hasPCB = true; m_hasPCB = true;
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * no valid board outline\n"; ostr << " * no valid board outline\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -695,9 +695,9 @@ bool PCBMODEL::CreatePCB()
if( !oln.MakeShape( board, m_thickness ) ) if( !oln.MakeShape( board, m_thickness ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not create board extrusion\n"; ostr << " * could not create board extrusion\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -715,9 +715,9 @@ bool PCBMODEL::CreatePCB()
else else
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not create board cutout\n"; ostr << " * could not create board cutout\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
} }
@ -751,9 +751,9 @@ bool PCBMODEL::CreatePCB()
if( sC == eC && !oln.m_curves.empty() ) if( sC == eC && !oln.m_curves.empty() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not close outline (dropping outline data with " << oln.m_curves.size() << " segments)\n"; ostr << " * could not close outline (dropping outline data with " << oln.m_curves.size() << " segments)\n";
for( const auto& c : oln.m_curves ) for( const auto& c : oln.m_curves )
@ -777,9 +777,9 @@ bool PCBMODEL::CreatePCB()
if( !oln.MakeShape( board, m_thickness ) ) if( !oln.MakeShape( board, m_thickness ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not create board extrusion\n"; ostr << " * could not create board extrusion\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -796,9 +796,9 @@ bool PCBMODEL::CreatePCB()
else else
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not create board cutout\n"; ostr << " * could not create board cutout\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
} }
@ -844,9 +844,9 @@ bool PCBMODEL::WriteIGES( const std::string& aFileName )
if( m_pcb_label.IsNull() ) if( m_pcb_label.IsNull() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * No valid PCB assembly; cannot create output file " << aFileName << "\n"; ostr << " * No valid PCB assembly; cannot create output file " << aFileName << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -878,9 +878,9 @@ bool PCBMODEL::WriteSTEP( const std::string& aFileName )
if( m_pcb_label.IsNull() ) if( m_pcb_label.IsNull() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * No valid PCB assembly; cannot create output file " << aFileName << "\n"; ostr << " * No valid PCB assembly; cannot create output file " << aFileName << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -934,9 +934,9 @@ bool PCBMODEL::getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_L
if( !readIGES( doc, aFileName.c_str() ) ) if( !readIGES( doc, aFileName.c_str() ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * readIGES() failed on filename '" << aFileName << "'\n"; ostr << " * readIGES() failed on filename '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -947,9 +947,9 @@ bool PCBMODEL::getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_L
if( !readSTEP( doc, aFileName.c_str() ) ) if( !readSTEP( doc, aFileName.c_str() ) )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * readSTEP() failed on filename '" << aFileName << "'\n"; ostr << " * readSTEP() failed on filename '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -1024,9 +1024,9 @@ bool PCBMODEL::getModelLabel( const std::string aFileName, TRIPLET aScale, TDF_L
if( aLabel.IsNull() ) if( aLabel.IsNull() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * could not transfer model data from file '" << aFileName << "'\n"; ostr << " * could not transfer model data from file '" << aFileName << "'\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
return false; return false;
@ -1223,9 +1223,9 @@ TDF_Label PCBMODEL::transferModel( Handle( TDocStd_Document )& source,
scaled_shape = brep.Shape(); scaled_shape = brep.Shape();
} else { } else {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * failed to scale model\n"; ostr << " * failed to scale model\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
scaled_shape = shape; scaled_shape = shape;
@ -1436,18 +1436,18 @@ bool OUTLINE::MakeShape( TopoDS_Shape& aShape, double aThickness )
} }
catch( const Standard_Failure& e ) catch( const Standard_Failure& e )
{ {
#ifdef __WXDEBUG__ #ifdef DEBUG
wxLogMessage( "Exception caught: %s", e.GetMessageString() ); wxLogMessage( "Exception caught: %s", e.GetMessageString() );
#endif /* __WXDEBUG */ #endif /* DEBUG */
success = false; success = false;
} }
if( !success ) if( !success )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * failed to add an edge: " << i.Describe() << "\n"; ostr << " * failed to add an edge: " << i.Describe() << "\n";
ostr << " * last valid outline point: " << lastPoint << "\n"; ostr << " * last valid outline point: " << lastPoint << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -1461,9 +1461,9 @@ bool OUTLINE::MakeShape( TopoDS_Shape& aShape, double aThickness )
if( aShape.IsNull() ) if( aShape.IsNull() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * failed to create a prismatic shape\n"; ostr << " * failed to create a prismatic shape\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -1510,9 +1510,9 @@ bool OUTLINE::addEdge( BRepBuilderAPI_MakeWire* aWire, KICADCURVE& aCurve, DOUBL
default: default:
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * unsupported curve type: " << aCurve.m_form << "\n"; ostr << " * unsupported curve type: " << aCurve.m_form << "\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );
@ -1529,9 +1529,9 @@ bool OUTLINE::addEdge( BRepBuilderAPI_MakeWire* aWire, KICADCURVE& aCurve, DOUBL
if( BRepBuilderAPI_DisconnectedWire == aWire->Error() ) if( BRepBuilderAPI_DisconnectedWire == aWire->Error() )
{ {
std::ostringstream ostr; std::ostringstream ostr;
#ifdef __WXDEBUG__ #ifdef DEBUG
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
#endif /* __WXDEBUG */ #endif /* DEBUG */
ostr << " * failed to add curve\n"; ostr << " * failed to add curve\n";
wxLogMessage( "%s", ostr.str().c_str() ); wxLogMessage( "%s", ostr.str().c_str() );