From c04e19f9ac7795a5ad200b380b5c0dacfa2a9dc2 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 20 Mar 2021 11:35:37 -0400 Subject: [PATCH] Include optimization: move some things from common.h to point-of-use --- 3d-viewer/3d_cache/3d_cache.cpp | 8 +-- 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 1 + common/CMakeLists.txt | 1 + common/bin_mod.cpp | 3 - common/bitmap.cpp | 1 - common/common.cpp | 43 ----------- common/dialogs/dialog_configure_paths.cpp | 1 + common/dialogs/dialog_page_settings.cpp | 3 +- common/dialogs/eda_list_dialog.cpp | 5 +- common/drawing_sheet/ds_painter.cpp | 1 + common/kiface_i.cpp | 8 +-- common/kiid.cpp | 1 - common/lockfile.cpp | 3 +- common/plotters/PDF_plotter.cpp | 11 +-- common/plotters/SVG_plotter.cpp | 2 +- .../cadstar/cadstar_archive_parser.cpp | 2 + common/plugins/eagle/eagle_parser.cpp | 3 +- common/plugins/eagle/eagle_parser.h | 6 +- common/preview_items/arc_assistant.cpp | 1 - common/preview_items/two_point_assistant.cpp | 4 +- common/project.cpp | 1 + common/settings/settings_manager.cpp | 3 +- common/single_top.cpp | 1 + common/tool/common_control.cpp | 4 +- common/widgets/gal_options_panel.cpp | 1 - common/wx_stl_compat.cpp | 63 ++++++++++++++++ cvpcb/readwrite_dlgs.cpp | 2 +- eeschema/class_library.cpp | 3 +- eeschema/eeschema_settings.cpp | 1 + eeschema/erc.cpp | 1 + .../netlist_exporter_xml.cpp | 1 + .../netlist_exporters/netlist_generator.cpp | 1 + eeschema/sch_field.cpp | 1 + .../cadstar/cadstar_sch_archive_loader.cpp | 1 + .../sch_plugins/eagle/sch_eagle_plugin.cpp | 1 + .../sch_plugins/legacy/sch_legacy_plugin.cpp | 1 + eeschema/sch_reference_list.h | 1 + eeschema/schematic_settings.cpp | 1 + eeschema/symbol_async_loader.cpp | 2 +- eeschema/tools/ee_grid_helper.cpp | 1 + gerbview/gerbview.cpp | 1 + include/asset_archive.h | 2 +- include/bin_mod.h | 8 --- include/common.h | 63 ++-------------- include/core/wx_stl_compat.h | 72 +++++++++++++++++++ include/dialogs/dialog_configure_paths.h | 3 +- include/inspectable.h | 2 + include/property.h | 2 + include/property_mgr.h | 5 +- include/settings/json_settings.h | 2 + kicad/files-io.cpp | 2 + kicad/import_project.cpp | 1 + kicad/kicad.cpp | 1 + pagelayout_editor/tools/pl_edit_tool.cpp | 1 + .../attenuators/attenuator_classes.cpp | 2 + pcbnew/build_BOM_from_board.cpp | 1 + pcbnew/connectivity/connectivity_items.cpp | 1 + pcbnew/dialogs/dialog_board_statistics.cpp | 2 +- pcbnew/dialogs/dialog_drc.cpp | 1 + pcbnew/dialogs/dialog_exchange_footprints.cpp | 1 + .../dialogs/dialog_footprint_wizard_list.cpp | 1 - .../dialog_graphic_item_properties.cpp | 1 + pcbnew/dialogs/panel_fp_lib_table.cpp | 2 + .../export_footprint_associations.cpp | 1 + .../exporters/export_footprints_placefile.cpp | 1 + pcbnew/exporters/export_gencad.cpp | 1 + pcbnew/exporters/export_hyperlynx.cpp | 1 + pcbnew/exporters/export_idf.cpp | 3 +- pcbnew/exporters/export_vrml.cpp | 4 +- pcbnew/exporters/gen_drill_report_files.cpp | 1 + pcbnew/exporters/gendrill_Excellon_writer.cpp | 1 + pcbnew/exporters/gerber_placefile_writer.cpp | 2 +- pcbnew/files.cpp | 2 +- pcbnew/footprint.cpp | 1 + pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/footprint_info_impl.cpp | 1 + pcbnew/footprint_libraries_utils.cpp | 1 + pcbnew/fp_shape.cpp | 3 +- pcbnew/netinfo_list.cpp | 1 + pcbnew/pcb_draw_panel_gal.cpp | 1 + pcbnew/pcb_shape.cpp | 1 + pcbnew/pcbnew.cpp | 3 +- pcbnew/plot_brditems_plotter.cpp | 2 +- .../cadstar/cadstar_pcb_archive_loader.cpp | 1 + pcbnew/plugins/eagle/eagle_plugin.cpp | 1 + pcbnew/plugins/eagle/eagle_plugin.h | 1 + pcbnew/plugins/geda/gpcb_plugin.cpp | 2 +- pcbnew/plugins/kicad/kicad_plugin.cpp | 32 +++++---- pcbnew/swig/pcbnew_scripting_helpers.cpp | 1 + pcbnew/swig/python_scripting.cpp | 1 + pcbnew/toolbars_pcb_editor.cpp | 2 +- pcbnew/tools/drawing_tool.cpp | 3 +- 92 files changed, 258 insertions(+), 195 deletions(-) create mode 100644 common/wx_stl_compat.cpp create mode 100644 include/core/wx_stl_compat.h diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp index 474667f3b2..fdb2855d8f 100644 --- a/3d-viewer/3d_cache/3d_cache.cpp +++ b/3d-viewer/3d_cache/3d_cache.cpp @@ -24,14 +24,11 @@ #define GLM_FORCE_RADIANS -#include -#include -#include #include -#include #include #include +#include #include #include #include @@ -44,9 +41,6 @@ #include #endif -#include -#include - #include "3d_cache.h" #include "3d_info.h" #include "3d_plugin_manager.h" diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 3a6fe834a1..2024781541 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -37,6 +37,7 @@ #include #include // To use GetRunningMicroSecs or another profiling utility #include +#include #include #include #include diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f5939ea63f..252d1696ee 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -396,6 +396,7 @@ set( COMMON_SRCS wildcards_and_files_ext.cpp drawing_sheet/ds_painter.cpp wxdataviewctrl_helpers.cpp + wx_stl_compat.cpp wx_filename.cpp xnode.cpp ) diff --git a/common/bin_mod.cpp b/common/bin_mod.cpp index 129f428e77..4e3dcbe2d3 100644 --- a/common/bin_mod.cpp +++ b/common/bin_mod.cpp @@ -23,11 +23,8 @@ */ #include -#include -#include #include #include -#include #include diff --git a/common/bitmap.cpp b/common/bitmap.cpp index 3a65a4461a..46da6cc4ac 100644 --- a/common/bitmap.cpp +++ b/common/bitmap.cpp @@ -44,7 +44,6 @@ #include #include #include -#include static std::unique_ptr s_BitmapStore; diff --git a/common/common.cpp b/common/common.cpp index 5e076c2de2..63f1b76706 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -347,49 +347,6 @@ bool EnsureFileDirectoryExists( wxFileName* aTargetFullFileName, } -// add this only if it is not in wxWidgets (for instance before 3.1.0) -#ifdef USE_KICAD_WXSTRING_HASH -size_t std::hash::operator()( const wxString& s ) const -{ - return std::hash{}( s.ToStdWstring() ); -} -#endif - -#ifdef USE_KICAD_WXPOINT_LESS_AND_HASH -size_t std::hash::operator() ( const wxPoint& k ) const -{ - auto xhash = std::hash()( k.x ); - - // 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) ) - // Adding this value ensures that consecutive bits of y will not be close to each other - // decreasing the likelihood of hash collision in similar values of x and y - return xhash ^ ( std::hash()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) ); -} - -bool std::less::operator()( const wxPoint& aA, const wxPoint& aB ) const -{ - if( aA.x == aB.x ) - return aA.y < aB.y; - - return aA.x < aB.x; -} -#endif - - -std::ostream& operator<<( std::ostream& out, const wxSize& size ) -{ - out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\""; - return out; -} - - -std::ostream& operator<<( std::ostream& out, const wxPoint& pt ) -{ - out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\""; - return out; -} - - /** * Performance enhancements to file and directory operations. * diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index 0c135e4f82..a70389196b 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index 1e6f39cfe4..f69f1b0ad3 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,6 +25,7 @@ #include #include #include +#include #include // for KiROUND, Clamp #include #include diff --git a/common/dialogs/eda_list_dialog.cpp b/common/dialogs/eda_list_dialog.cpp index b9cb686315..f2a27c2537 100644 --- a/common/dialogs/eda_list_dialog.cpp +++ b/common/dialogs/eda_list_dialog.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,9 +23,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include -#include +#include // wxWidgets spends *far* too long calcuating column widths (most of it, believe it or diff --git a/common/drawing_sheet/ds_painter.cpp b/common/drawing_sheet/ds_painter.cpp index fd72a8d41b..ad4ad58f4d 100644 --- a/common/drawing_sheet/ds_painter.cpp +++ b/common/drawing_sheet/ds_painter.cpp @@ -23,6 +23,7 @@ */ +#include #include #include #include diff --git a/common/kiface_i.cpp b/common/kiface_i.cpp index bd501bd808..5eb6c21b74 100644 --- a/common/kiface_i.cpp +++ b/common/kiface_i.cpp @@ -23,15 +23,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include // FROM_UTF8() -#include - #include -#include +#include +#include #include -#include - /// Initialize aDst SEARCH_STACK with KIFACE (DSO) specific settings. /// A non-member function so it an be moved easily, plus it's nobody's business. static void setSearchPaths( SEARCH_STACK* aDst, KIWAY::FACE_T aId ) diff --git a/common/kiid.cpp b/common/kiid.cpp index 771a981d06..b9f89b1d6f 100644 --- a/common/kiid.cpp +++ b/common/kiid.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include // AsLegacyTimestampString, AsString #include #include diff --git a/common/lockfile.cpp b/common/lockfile.cpp index ff175949d6..269f965225 100644 --- a/common/lockfile.cpp +++ b/common/lockfile.cpp @@ -22,13 +22,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include #include #include #include -#include std::unique_ptr LockFile( const wxString& aFileName ) { diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 04c2fd7d62..3a2d905219 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -27,17 +27,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include -#include + +#include #include -#include +#include + #include +#include +#include +#include #include "plotters_pslike.h" - std::string PDF_PLOTTER::encodeStringForPlotter( const wxString& aText ) { // returns a string compatible with PDF string convention from a unicode string. diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 9eb7bb60e3..90679e78c1 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -94,8 +94,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/common/plugins/cadstar/cadstar_archive_parser.cpp b/common/plugins/cadstar/cadstar_archive_parser.cpp index 32ae25d7e6..a94f1b8c0d 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.cpp +++ b/common/plugins/cadstar/cadstar_archive_parser.cpp @@ -22,9 +22,11 @@ * @file cadstar_archive_parser.cpp * @brief Helper functions and common defines between schematic and PCB Archive files */ +#include #include #include +#include #include // Ratio derived from CADSTAR default font. See doxygen comment in cadstar_archive_parser.h diff --git a/common/plugins/eagle/eagle_parser.cpp b/common/plugins/eagle/eagle_parser.cpp index 506c708a52..41c3c5cda4 100644 --- a/common/plugins/eagle/eagle_parser.cpp +++ b/common/plugins/eagle/eagle_parser.cpp @@ -27,11 +27,10 @@ #include +#include #include #include -#include -#include #include constexpr auto DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT; diff --git a/common/plugins/eagle/eagle_parser.h b/common/plugins/eagle/eagle_parser.h index e44402da43..102ed0fa48 100644 --- a/common/plugins/eagle/eagle_parser.h +++ b/common/plugins/eagle/eagle_parser.h @@ -29,8 +29,8 @@ #ifndef _EAGLE_PARSER_H_ #define _EAGLE_PARSER_H_ -#include #include +#include #include #include @@ -38,10 +38,8 @@ #include #include -#include #include -#include -#include // needed for wxString hash template +#include class FOOTPRINT; struct EINSTANCE; diff --git a/common/preview_items/arc_assistant.cpp b/common/preview_items/arc_assistant.cpp index e0493bc94f..bed900dad8 100644 --- a/common/preview_items/arc_assistant.cpp +++ b/common/preview_items/arc_assistant.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/common/preview_items/two_point_assistant.cpp b/common/preview_items/two_point_assistant.cpp index 29191c5a14..ceedd5b4e2 100644 --- a/common/preview_items/two_point_assistant.cpp +++ b/common/preview_items/two_point_assistant.cpp @@ -25,7 +25,7 @@ #include #include #include -#include + using namespace KIGFX::PREVIEW; @@ -94,4 +94,4 @@ void TWO_POINT_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const // place the text next to cursor, on opposite side from drawing DrawTextNextToCursor( aView, end, origin - end, cursorStrings, aLayer == LAYER_SELECT_OVERLAY ); -} \ No newline at end of file +} diff --git a/common/project.cpp b/common/project.cpp index bb19a9f3ec..a5f530f637 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index ad5870274f..938ffc6884 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -36,14 +37,12 @@ #include #include #include -#include #include #include #include #include - /// Project settings path will be + this #define PROJECT_BACKUPS_DIR_SUFFIX wxT( "-backups" ) diff --git a/common/single_top.cpp b/common/single_top.cpp index 4cd1d46c30..720dbb390e 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/common/tool/common_control.cpp b/common/tool/common_control.cpp index a03fc4617a..8c409d391e 100644 --- a/common/tool/common_control.cpp +++ b/common/tool/common_control.cpp @@ -24,17 +24,15 @@ #include #include +#include // for SearchHelpFileFullPath #include #include #include -#include #include -#include #include #include #include #include -#include #include #include #include diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 213dcb6e77..b3a69ef892 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -32,7 +32,6 @@ #include #include -#include #include diff --git a/common/wx_stl_compat.cpp b/common/wx_stl_compat.cpp new file mode 100644 index 0000000000..eac3fab4d2 --- /dev/null +++ b/common/wx_stl_compat.cpp @@ -0,0 +1,63 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include +#include + +// add this only if it is not in wxWidgets (for instance before 3.1.0) +#ifdef USE_KICAD_WXSTRING_HASH +size_t std::hash::operator()( const wxString& s ) const +{ + return std::hash{}( s.ToStdWstring() ); +} +#endif + +#ifdef USE_KICAD_WXPOINT_LESS_AND_HASH +size_t std::hash::operator() ( const wxPoint& k ) const +{ + auto xhash = std::hash()( k.x ); + + // 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) ) + // Adding this value ensures that consecutive bits of y will not be close to each other + // decreasing the likelihood of hash collision in similar values of x and y + return xhash ^ ( std::hash()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) ); +} + +bool std::less::operator()( const wxPoint& aA, const wxPoint& aB ) const +{ + if( aA.x == aB.x ) + return aA.y < aB.y; + + return aA.x < aB.x; +} +#endif + + +std::ostream& operator<<( std::ostream& out, const wxSize& size ) +{ + out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\""; + return out; +} + + +std::ostream& operator<<( std::ostream& out, const wxPoint& pt ) +{ + out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\""; + return out; +} diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp index cc5099ba52..c530484719 100644 --- a/cvpcb/readwrite_dlgs.cpp +++ b/cvpcb/readwrite_dlgs.cpp @@ -28,9 +28,9 @@ #include #include #include +#include #include -#include #include diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index 9022fe0c2c..234281d8f5 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include #include #include #include diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 124a54527e..db604b27c3 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index efe09cb9cc..5d60a366ce 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -24,6 +24,7 @@ */ #include "connection_graph.h" +#include // for ExpandEnvVarSubstitutions #include #include #include diff --git a/eeschema/netlist_exporters/netlist_exporter_xml.cpp b/eeschema/netlist_exporters/netlist_exporter_xml.cpp index 1236259304..c3a6ce5e9a 100644 --- a/eeschema/netlist_exporters/netlist_exporter_xml.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_xml.cpp @@ -26,6 +26,7 @@ #include "netlist_exporter_xml.h" #include +#include // for ExpandTextVars #include #include #include diff --git a/eeschema/netlist_exporters/netlist_generator.cpp b/eeschema/netlist_exporters/netlist_generator.cpp index a056c51a95..f5e9defcc6 100644 --- a/eeschema/netlist_exporters/netlist_generator.cpp +++ b/eeschema/netlist_exporters/netlist_generator.cpp @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include // for ProcessExecute #include #include #include diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 490575cc01..240b33e1c1 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -32,6 +32,7 @@ */ #include +#include // for ExpandTextVars #include #include #include diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index 9e8dd21fdc..25a9485060 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include //COMPONENT_ORIENTATION_T diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index c6246a3926..e71bf3084f 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index 691e1d3f49..fe3bbeb41c 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/eeschema/sch_reference_list.h b/eeschema/sch_reference_list.h index d38618b340..a9609f427c 100644 --- a/eeschema/sch_reference_list.h +++ b/eeschema/sch_reference_list.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/schematic_settings.cpp b/eeschema/schematic_settings.cpp index e37a301179..17a455f9bf 100644 --- a/eeschema/schematic_settings.cpp +++ b/eeschema/schematic_settings.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/symbol_async_loader.cpp b/eeschema/symbol_async_loader.cpp index 643885b362..bfa3a7da5e 100644 --- a/eeschema/symbol_async_loader.cpp +++ b/eeschema/symbol_async_loader.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include diff --git a/eeschema/tools/ee_grid_helper.cpp b/eeschema/tools/ee_grid_helper.cpp index e538fa0b43..aff08a6464 100644 --- a/eeschema/tools/ee_grid_helper.cpp +++ b/eeschema/tools/ee_grid_helper.cpp @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff --git a/gerbview/gerbview.cpp b/gerbview/gerbview.cpp index 1f25ed6fb1..54c4795dfd 100644 --- a/gerbview/gerbview.cpp +++ b/gerbview/gerbview.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/include/asset_archive.h b/include/asset_archive.h index 7cc8629c7c..56961c5a51 100644 --- a/include/asset_archive.h +++ b/include/asset_archive.h @@ -23,7 +23,7 @@ #include #include -#include // Unordered map of wxString +#include /** * An asset archive represents a file containing data assets that are loaded from disk and then diff --git a/include/bin_mod.h b/include/bin_mod.h index 338a7510c9..cab9c343ac 100644 --- a/include/bin_mod.h +++ b/include/bin_mod.h @@ -24,17 +24,9 @@ #ifndef BIN_MOD_H_ #define BIN_MOD_H_ -/// @todo Should this be a check for the wxWidgets version rather that `#if 0`. -#if 0 - #include // wx 3.0: -#else - #include -#endif - #include #include -#include class APP_SETTINGS_BASE; diff --git a/include/common.h b/include/common.h index 53fb1bf75b..76ca05bb26 100644 --- a/include/common.h +++ b/include/common.h @@ -32,22 +32,12 @@ #ifndef INCLUDE__COMMON_H_ #define INCLUDE__COMMON_H_ -#include #include - -#include -#include -#include -#include -#include -#include - -#include -#include #include -#include -#include -#include + +#include +#include +#include class PROJECT; class SEARCH_STACK; @@ -124,51 +114,6 @@ wxString ExpandTextVars( const wxString& aSource, const PROJECT* aProject ); */ const wxString ResolveUriByEnvVars( const wxString& aUri, PROJECT* aProject ); -// Some wxWidgets versions (for instance before 3.1.0) do not include -// this function, so add it if missing -#if !wxCHECK_VERSION( 3, 1, 0 ) -#define USE_KICAD_WXSTRING_HASH // for common.cpp -///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map) -namespace std -{ - template<> struct hash - { - size_t operator()( const wxString& s ) const; - }; -} -#endif - -/// Required to use wxPoint as key type in maps -#define USE_KICAD_WXPOINT_LESS_AND_HASH // for common.cpp -namespace std -{ - template <> struct hash - { - size_t operator() ( const wxPoint& k ) const; - }; -} - -namespace std -{ - template<> struct less - { - bool operator()( const wxPoint& aA, const wxPoint& aB ) const; - }; -} - -/** - * Helper function to print the given wxSize to a stream. - * - * Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures. - */ -std::ostream& operator<<( std::ostream& out, const wxSize& size ); - -/** - * Helper function to print the given wxPoint to a stream. - * - * Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures. - */ -std::ostream& operator<<( std::ostream& out, const wxPoint& pt ); long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec ); diff --git a/include/core/wx_stl_compat.h b/include/core/wx_stl_compat.h new file mode 100644 index 0000000000..c6ae56c21d --- /dev/null +++ b/include/core/wx_stl_compat.h @@ -0,0 +1,72 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef KICAD_WX_STL_COMPAT_H +#define KICAD_WX_STL_COMPAT_H + +#include +#include + +// Some wxWidgets versions (for instance before 3.1.0) do not include +// this function, so add it if missing +#if !wxCHECK_VERSION( 3, 1, 0 ) +#define USE_KICAD_WXSTRING_HASH // for common.cpp +///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map) +namespace std +{ + template<> struct hash + { + size_t operator()( const wxString& s ) const; + }; +} +#endif + +/// Required to use wxPoint as key type in maps +#define USE_KICAD_WXPOINT_LESS_AND_HASH // for common.cpp +namespace std +{ + template <> struct hash + { + size_t operator() ( const wxPoint& k ) const; + }; +} + +namespace std +{ + template<> struct less + { + bool operator()( const wxPoint& aA, const wxPoint& aB ) const; + }; +} + +/** + * Helper function to print the given wxSize to a stream. + * + * Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures. + */ +std::ostream& operator<<( std::ostream& out, const wxSize& size ); + +/** + * Helper function to print the given wxPoint to a stream. + * + * Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures. + */ +std::ostream& operator<<( std::ostream& out, const wxPoint& pt ); + +#endif // KICAD_WX_STL_COMPAT_H diff --git a/include/dialogs/dialog_configure_paths.h b/include/dialogs/dialog_configure_paths.h index 0c6ed8682c..85905aa282 100644 --- a/include/dialogs/dialog_configure_paths.h +++ b/include/dialogs/dialog_configure_paths.h @@ -27,11 +27,10 @@ #include <../common/dialogs/dialog_configure_paths_base.h> +#include #include -#include -class EDA_DRAW_FRAME; class FILENAME_RESOLVER; class HTML_MESSAGE_BOX; diff --git a/include/inspectable.h b/include/inspectable.h index a3a307cee5..d38bfd1487 100644 --- a/include/inspectable.h +++ b/include/inspectable.h @@ -22,6 +22,8 @@ #ifndef INSPECTABLE_H #define INSPECTABLE_H +#include + #include "property_mgr.h" #include "property.h" diff --git a/include/property.h b/include/property.h index 17e191d656..c883f82a1f 100644 --- a/include/property.h +++ b/include/property.h @@ -24,6 +24,8 @@ #ifndef PROPERTY_H #define PROPERTY_H +#include + #include #include #include diff --git a/include/property_mgr.h b/include/property_mgr.h index f13f0b6e72..4a5d3078c8 100644 --- a/include/property_mgr.h +++ b/include/property_mgr.h @@ -24,6 +24,8 @@ #ifndef PROPERTY_MGR_H #define PROPERTY_MGR_H +#include // Needed for stl hash extensions + #include #include @@ -33,9 +35,6 @@ #include #include - -#include // Needed for stl hash extensions - class PROPERTY_BASE; class TYPE_CAST_BASE; diff --git a/include/settings/json_settings.h b/include/settings/json_settings.h index 04a12ad4a5..97c4006a6b 100644 --- a/include/settings/json_settings.h +++ b/include/settings/json_settings.h @@ -21,6 +21,8 @@ #ifndef _JSON_SETTINGS_H #define _JSON_SETTINGS_H +#include + #include #include #include diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index 1b649e07d3..8930afaf51 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -26,6 +26,8 @@ * @file kicad/files-io.cpp */ +#include + #include #include #include diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp index 22b3e0746b..d927dcf0e2 100644 --- a/kicad/import_project.cpp +++ b/kicad/import_project.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index d8d4b7fbb2..597cf2e234 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index faac7ce6c7..ec570fb458 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include // for KiROUND diff --git a/pcb_calculator/attenuators/attenuator_classes.cpp b/pcb_calculator/attenuators/attenuator_classes.cpp index 6eecdd0057..3bf3bc6ee6 100644 --- a/pcb_calculator/attenuators/attenuator_classes.cpp +++ b/pcb_calculator/attenuators/attenuator_classes.cpp @@ -6,6 +6,8 @@ ** *****************************************************************************/ +#include + #include #include #include diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index e4588c11f4..3f15a2d047 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include diff --git a/pcbnew/connectivity/connectivity_items.cpp b/pcbnew/connectivity/connectivity_items.cpp index b480466ae4..6190c9d479 100644 --- a/pcbnew/connectivity/connectivity_items.cpp +++ b/pcbnew/connectivity/connectivity_items.cpp @@ -26,6 +26,7 @@ */ #include +#include #include int CN_ITEM::AnchorCount() const diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 0417365854..c53f001efe 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -25,7 +25,7 @@ #include "dialog_board_statistics.h" #include "base_units.h" -#include "common.h" +#include #include #define COL_LABEL 0 diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 66d79bbac9..abcdd63ac7 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index b67f279b06..22235c0709 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index 4ab0cb474f..38f95c639c 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -28,7 +28,6 @@ #include -#include #include #include #include diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index 763504142b..d1f7ad91af 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index ac1cb842b6..a98e2cea1d 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -32,6 +32,7 @@ #include +#include #include #include @@ -60,6 +61,7 @@ #include // For ID_PCBNEW_END_LIST #include #include +#include // clang-format off diff --git a/pcbnew/exporters/export_footprint_associations.cpp b/pcbnew/exporters/export_footprint_associations.cpp index 43ecc25b93..afaa54c351 100644 --- a/pcbnew/exporters/export_footprint_associations.cpp +++ b/pcbnew/exporters/export_footprint_associations.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/exporters/export_footprints_placefile.cpp b/pcbnew/exporters/export_footprints_placefile.cpp index fb66112998..1b3b28b7e5 100644 --- a/pcbnew/exporters/export_footprints_placefile.cpp +++ b/pcbnew/exporters/export_footprints_placefile.cpp @@ -27,6 +27,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index fb5452dcf5..f08e05e69f 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index ebf96c3a2e..e4daa1a1a0 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index 81b61c43d3..893e07a7c3 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -28,13 +28,12 @@ #include #include +#include #include -#include #include #include #include #include -#include <3d_cache/3d_info.h> #include #include "project.h" #include "kiway.h" diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index bf743a15d2..49d9a8c073 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -37,7 +37,6 @@ #include "footprint.h" #include "pcb_text.h" #include "track.h" -#include "zone.h" #include "convert_to_biu.h" #include #include @@ -46,10 +45,9 @@ #include "vrml_layer.h" #include "pcb_edit_frame.h" -#include #include #include -#include +#include #include diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 207d05f128..f8657c8fdc 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include // for KiROUND #include diff --git a/pcbnew/exporters/gendrill_Excellon_writer.cpp b/pcbnew/exporters/gendrill_Excellon_writer.cpp index 1e6d9216bb..0358a20363 100644 --- a/pcbnew/exporters/gendrill_Excellon_writer.cpp +++ b/pcbnew/exporters/gendrill_Excellon_writer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index 950cef4d30..6d8c1fb7dc 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -38,7 +39,6 @@ #include #include -#include #include #include diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 78451c01c8..2c687fd50c 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 54a049069a..71b23e0e66 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 569d594afd..02c27dd704 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -44,12 +44,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index 1566a476f2..d61af1371a 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index 96da61e971..da04d6d920 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/fp_shape.cpp b/pcbnew/fp_shape.cpp index 3eb4e9d85b..e183dd41d5 100644 --- a/pcbnew/fp_shape.cpp +++ b/pcbnew/fp_shape.cpp @@ -24,13 +24,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include +#include #include // for KiROUND #include #include #include -#include #include #include #include diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index a5c2bd28b1..d989ee7e22 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index ca8f9c3103..7ba004d8a6 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index f889ba131c..46f2093a7a 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 46a1a863ae..073bade699 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +54,6 @@ #include #include #include -#include #include "invoke_pcb_dialog.h" #include "dialog_global_fp_lib_table_config.h" #include diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index f24ee05ca6..ad1bc56be1 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -27,13 +27,13 @@ #include // for NULL, size_t #include // for vector, __vector_base<>... -#include #include // for SEG #include #include // for SHAPE_LINE_CHAIN #include // for SHAPE_POLY_SET, SHAPE_P... #include #include +#include #include // for KiROUND, Clamp #include // for VECTOR2I #include diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index 4095d798f8..3c09a119d1 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include // std::numeric_limits diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index 11f05e8351..fd242af247 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -61,6 +61,7 @@ Load() TODO's #include #include #include +#include #include #include #include // for KiROUND diff --git a/pcbnew/plugins/eagle/eagle_plugin.h b/pcbnew/plugins/eagle/eagle_plugin.h index 36a02de1da..14263616e1 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.h +++ b/pcbnew/plugins/eagle/eagle_plugin.h @@ -25,6 +25,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index a7d8ea02b0..8d264656bc 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,6 @@ #include #include #include -#include static inline long parseInt( const wxString& aValue, double aScalar ) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index bb89fa47c5..a98a556e2d 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -22,30 +22,32 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include -#include #include -#include -#include +#include +#include +#include // for enum RECT_CHAMFER_POSITIONS definition +#include #include -#include -#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include #include #include -#include -#include -#include // for enum RECT_CHAMFER_POSITIONS definition -#include +#include +#include +#include +#include #include +#include +#include using namespace PCB_KEYS_T; diff --git a/pcbnew/swig/pcbnew_scripting_helpers.cpp b/pcbnew/swig/pcbnew_scripting_helpers.cpp index abffbf438b..8718b04ce4 100644 --- a/pcbnew/swig/pcbnew_scripting_helpers.cpp +++ b/pcbnew/swig/pcbnew_scripting_helpers.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/swig/python_scripting.cpp b/pcbnew/swig/python_scripting.cpp index 9ada70902d..2ccacd2384 100644 --- a/pcbnew/swig/python_scripting.cpp +++ b/pcbnew/swig/python_scripting.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index b9eecd2da9..c1e9448f94 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 856460a5fb..bfba485063 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -30,12 +30,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -58,6 +56,7 @@ #include #include #include +#include #include using SCOPED_DRAW_MODE = SCOPED_SET_RESET;