From 89dd8e116691fc11dedce59004d52bfbb1704db0 Mon Sep 17 00:00:00 2001
From: Marek Roszko <mark.roszko@gmail.com>
Date: Sat, 13 Apr 2024 07:59:25 -0400
Subject: [PATCH] Move the PARAM_LIST<> specializations for BOM to bom_settings

---
 common/settings/bom_settings.cpp |  5 +++++
 common/settings/parameters.cpp   |  2 --
 include/settings/bom_settings.h  | 14 ++++++++------
 include/settings/parameters.h    |  5 -----
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/common/settings/bom_settings.cpp b/common/settings/bom_settings.cpp
index 9ca939368d..81c4ebf9f7 100644
--- a/common/settings/bom_settings.cpp
+++ b/common/settings/bom_settings.cpp
@@ -244,3 +244,8 @@ std::vector<BOM_FMT_PRESET> BOM_FMT_PRESET::BuiltInPresets()
 {
     return { BOM_FMT_PRESET::CSV(), BOM_FMT_PRESET::TSV(), BOM_FMT_PRESET::Semicolons() };
 }
+
+#if !defined( __MINGW32__ )
+template class KICOMMON_API PARAM_LIST<struct BOM_PRESET>;
+template class KICOMMON_API PARAM_LIST<struct BOM_FMT_PRESET>;
+#endif
\ No newline at end of file
diff --git a/common/settings/parameters.cpp b/common/settings/parameters.cpp
index 66c61465ae..a3bcf7ed41 100644
--- a/common/settings/parameters.cpp
+++ b/common/settings/parameters.cpp
@@ -128,8 +128,6 @@ template class KICOMMON_API PARAM_LIST<double>;
 template class KICOMMON_API PARAM_LIST<wxString>;
 template class KICOMMON_API PARAM_LIST<KIGFX::COLOR4D>;
 //template KICOMMON_API class PARAM_LIST<FILE_INFO_PAIR>;
-template class KICOMMON_API PARAM_LIST<struct BOM_PRESET>;
-template class KICOMMON_API PARAM_LIST<struct BOM_FMT_PRESET>;
 template class KICOMMON_API PARAM_LIST<GRID>;
 
 template class KICOMMON_API PARAM_SET<wxString>;
diff --git a/include/settings/bom_settings.h b/include/settings/bom_settings.h
index 57c9313d44..bc7869b216 100644
--- a/include/settings/bom_settings.h
+++ b/include/settings/bom_settings.h
@@ -38,10 +38,10 @@ struct KICOMMON_API BOM_FIELD
 };
 
 KICOMMON_API bool operator!=( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
-KICOMMON_API bool  operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
+KICOMMON_API bool operator<( const BOM_FIELD& lhs, const BOM_FIELD& rhs );
 
 KICOMMON_API void to_json( nlohmann::json& j, const BOM_FIELD& f );
-KICOMMON_API void  from_json( const nlohmann::json& j, BOM_FIELD& f );
+KICOMMON_API void from_json( const nlohmann::json& j, BOM_FIELD& f );
 
 
 // A complete preset defining a BOM "View" with a list of all the fields to show,
@@ -67,10 +67,10 @@ struct KICOMMON_API BOM_PRESET
 };
 
 KICOMMON_API bool operator!=( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
-KICOMMON_API bool  operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
+KICOMMON_API bool operator<( const BOM_PRESET& lhs, const BOM_PRESET& rhs );
 
 KICOMMON_API void to_json( nlohmann::json& j, const BOM_PRESET& f );
-KICOMMON_API void  from_json( const nlohmann::json& j, BOM_PRESET& f );
+KICOMMON_API void from_json( const nlohmann::json& j, BOM_PRESET& f );
 
 
 // A formatting preset, like CSV (Comma Separated Values)
@@ -95,10 +95,12 @@ struct KICOMMON_API BOM_FMT_PRESET
 };
 
 KICOMMON_API bool operator!=( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
-KICOMMON_API bool  operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
+KICOMMON_API bool operator<( const BOM_FMT_PRESET& lhs, const BOM_FMT_PRESET& rhs );
 
 KICOMMON_API void to_json( nlohmann::json& j, const BOM_FMT_PRESET& f );
-KICOMMON_API void  from_json( const nlohmann::json& j, BOM_FMT_PRESET& f );
+KICOMMON_API void from_json( const nlohmann::json& j, BOM_FMT_PRESET& f );
 
+extern template class APIVISIBLE PARAM_LIST<struct BOM_PRESET>;
+extern template class APIVISIBLE PARAM_LIST<struct BOM_FMT_PRESET>;
 
 #endif
diff --git a/include/settings/parameters.h b/include/settings/parameters.h
index 7e9af4f248..3320917a87 100644
--- a/include/settings/parameters.h
+++ b/include/settings/parameters.h
@@ -29,7 +29,6 @@
 #include <optional>
 #include <gal/color4d.h>
 #include <settings/json_settings.h>
-#include <settings/bom_settings.h>
 #include <settings/grid_settings.h>
 #include <kicommon.h>
 
@@ -562,8 +561,6 @@ template class KICOMMON_API PARAM_LIST<bool>;
 template class KICOMMON_API PARAM_LIST<int>;
 template class KICOMMON_API PARAM_LIST<double>;
 template class KICOMMON_API PARAM_LIST<KIGFX::COLOR4D>;
-template class KICOMMON_API PARAM_LIST<struct BOM_PRESET>;
-template class KICOMMON_API PARAM_LIST<struct BOM_FMT_PRESET>;
 template class KICOMMON_API PARAM_LIST<GRID>;
 template class KICOMMON_API PARAM_LIST<wxString>;
 #else
@@ -571,8 +568,6 @@ extern template class APIVISIBLE PARAM_LIST<bool>;
 extern template class APIVISIBLE PARAM_LIST<int>;
 extern template class APIVISIBLE PARAM_LIST<double>;
 extern template class APIVISIBLE PARAM_LIST<KIGFX::COLOR4D>;
-extern template class APIVISIBLE PARAM_LIST<struct BOM_PRESET>;
-extern template class APIVISIBLE PARAM_LIST<struct BOM_FMT_PRESET>;
 extern template class APIVISIBLE PARAM_LIST<GRID>;
 extern template class APIVISIBLE PARAM_LIST<wxString>;
 #endif