From 7c9f3981ef71c2f9934701e42e88b4d1fcb50b7d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 12 Nov 2022 20:45:56 +0100 Subject: [PATCH] Revert "Reorder includes is some simulator files to fix issues on msys2 (no code change)" This reverts commit 78e45fa1b9e9a03858a00b29ffaa999413dbdf82. Looks like it creates a compil issue on MSVC --- eeschema/erc.cpp | 5 +++-- eeschema/sim/ngspice.h | 8 +++----- eeschema/sim/sim_lib_mgr.cpp | 9 +++------ eeschema/sim/sim_model.cpp | 10 +++++----- eeschema/sim/sim_model_kibis.cpp | 7 +++---- eeschema/sim/sim_model_spice.cpp | 4 +--- eeschema/sim/sim_plot_frame.cpp | 17 ++++++----------- eeschema/sim/sim_property.cpp | 8 +++----- eeschema/sim/sim_property.h | 4 +--- eeschema/sim/sim_value.h | 6 ++---- eeschema/sim/spice_simulator.cpp | 6 ++---- eeschema/sim/spice_value.cpp | 8 ++------ 12 files changed, 34 insertions(+), 58 deletions(-) diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index f88e52d6e7..3a38d71978 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -24,7 +24,6 @@ */ #include "connection_graph.h" -#include "sim/sim_model.h" #include // for ExpandEnvVarSubstitutions #include #include @@ -42,6 +41,8 @@ #include #include +#include "sim/sim_model.h" + /* ERC tests : * 1 - conflicts between connected pins ( example: 2 connected outputs ) @@ -530,7 +531,7 @@ int ERC_TESTER::TestPinToPin() std::swap( first_pin, second_pin ); std::pair pair = std::make_pair( first_pin, second_pin ); - + if( auto [ins_pin, inserted ] = tested.insert( pair ); !inserted ) continue; diff --git a/eeschema/sim/ngspice.h b/eeschema/sim/ngspice.h index 68063331be..4542e11552 100644 --- a/eeschema/sim/ngspice.h +++ b/eeschema/sim/ngspice.h @@ -27,14 +27,12 @@ #ifndef NGSPICE_H #define NGSPICE_H -#include - -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) -#include "sim/spice_simulator.h" +#include #include #include +#include + #include #include diff --git a/eeschema/sim/sim_lib_mgr.cpp b/eeschema/sim/sim_lib_mgr.cpp index e92dbabeb6..9db39f2dee 100644 --- a/eeschema/sim/sim_lib_mgr.cpp +++ b/eeschema/sim/sim_lib_mgr.cpp @@ -22,15 +22,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include -#include -#include - -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) #include #include -#include +#include +#include SIM_LIB_MGR::SIM_LIB_MGR( const PROJECT& aPrj ) : m_project( aPrj ) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 8a02b89454..f2b2f047f0 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -22,9 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include - #include #include #include @@ -41,6 +38,9 @@ #include +#include +#include + #include #include #include @@ -833,7 +833,7 @@ std::unique_ptr SIM_MODEL::Create( TYPE aType ) case TYPE::C: case TYPE::L: return std::make_unique( aType ); - + case TYPE::R_POT: return std::make_unique(); @@ -924,7 +924,7 @@ SIM_MODEL::SIM_MODEL( TYPE aType, SIM_MODEL::SIM_MODEL( TYPE aType, std::unique_ptr aSpiceGenerator, - std::unique_ptr aSerde ) : + std::unique_ptr aSerde ) : m_baseModel( nullptr ), m_serde( std::move( aSerde ) ), m_spiceGenerator( std::move( aSpiceGenerator ) ), diff --git a/eeschema/sim/sim_model_kibis.cpp b/eeschema/sim/sim_model_kibis.cpp index 5221831a00..41738ccf68 100644 --- a/eeschema/sim/sim_model_kibis.cpp +++ b/eeschema/sim/sim_model_kibis.cpp @@ -21,15 +21,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include +#include +#include #include #include #include #include -#include -#include -#include - std::string SPICE_GENERATOR_KIBIS::ModelName( const SPICE_ITEM& aItem ) const { return fmt::format( "{}.{}", aItem.refName, aItem.baseModelName ); diff --git a/eeschema/sim/sim_model_spice.cpp b/eeschema/sim/sim_model_spice.cpp index 314ecf28a6..c302bc6ea0 100644 --- a/eeschema/sim/sim_model_spice.cpp +++ b/eeschema/sim/sim_model_spice.cpp @@ -21,14 +21,12 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) #include #include #include #include +#include #include diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 00a79eda7f..22668a2d24 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -26,9 +26,6 @@ #include #include -// For some obscure reason, needed on msys2 with some wxWidgets versions (3.0) to avoid -// undefined symbol at link stage (due to use of #include ) -#include #include #include @@ -43,6 +40,12 @@ #include "string_utils.h" #include "ngspice_helpers.h" #include +#include "ngspice.h" +#include "sim_plot_colors.h" +#include "sim_plot_frame.h" +#include "sim_plot_panel.h" +#include "spice_simulator.h" +#include "spice_reporter.h" #include #include #include @@ -52,14 +55,6 @@ #include #include -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) -#include "ngspice.h" -#include "sim_plot_colors.h" -#include "sim_plot_frame.h" -#include "sim_plot_panel.h" -#include "spice_simulator.h" -#include "spice_reporter.h" SIM_PLOT_TYPE operator|( SIM_PLOT_TYPE aFirst, SIM_PLOT_TYPE aSecond ) { diff --git a/eeschema/sim/sim_property.cpp b/eeschema/sim/sim_property.cpp index ad544c3299..7e5580695e 100644 --- a/eeschema/sim/sim_property.cpp +++ b/eeschema/sim/sim_property.cpp @@ -21,17 +21,15 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#include +#include #include #include #include #include #include -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) -#include -#include - wxBEGIN_EVENT_TABLE( SIM_VALIDATOR, wxValidator ) EVT_KEY_DOWN( SIM_VALIDATOR::onKeyDown ) diff --git a/eeschema/sim/sim_property.h b/eeschema/sim/sim_property.h index 79dfe19bec..e9450d5a49 100644 --- a/eeschema/sim/sim_property.h +++ b/eeschema/sim/sim_property.h @@ -25,15 +25,13 @@ #ifndef SIM_PROPERTY_H #define SIM_PROPERTY_H +#include #include #include #include #include #include -// Include this header after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) -#include class SIM_VALIDATOR : public wxValidator { diff --git a/eeschema/sim/sim_value.h b/eeschema/sim/sim_value.h index 36dbc6de33..2b9e066c47 100644 --- a/eeschema/sim/sim_value.h +++ b/eeschema/sim/sim_value.h @@ -29,11 +29,9 @@ #include #include #include - -// Include this header after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) #include + namespace SIM_VALUE_GRAMMAR { using namespace tao::pegtl; @@ -163,7 +161,7 @@ namespace SIM_VALUE_GRAMMAR template struct significand; - + template <> struct significand : sor, fracPart>, seq>, diff --git a/eeschema/sim/spice_simulator.cpp b/eeschema/sim/spice_simulator.cpp index a8ee285fb7..1627ec9e33 100644 --- a/eeschema/sim/spice_simulator.cpp +++ b/eeschema/sim/spice_simulator.cpp @@ -23,12 +23,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) #include "ngspice.h" +#include + std::shared_ptr SIMULATOR::CreateInstance( const std::string& ) { try diff --git a/eeschema/sim/spice_value.cpp b/eeschema/sim/spice_value.cpp index 934823ff8f..26649f5d12 100644 --- a/eeschema/sim/spice_value.cpp +++ b/eeschema/sim/spice_value.cpp @@ -22,10 +22,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "spice_value.h" + #include #include -#include #include #include #include @@ -33,11 +34,6 @@ #include #include -// Include simulator headers after wxWidgets headers to avoid conflicts with Windows headers -// (especially on msys2) -#include "spice_value.h" - - SPICE_VALUE::SPICE_VALUE( const wxString& aString ) { char buf[8] = { 0, };