From 0eae398efeda6acc7800dd8c001b2a09133d465c Mon Sep 17 00:00:00 2001 From: Pete Peterson Date: Fri, 20 Dec 2024 15:55:26 -0500 Subject: [PATCH] Change from System.h to DllConfig.h This is part of #38457 which cleans up all of Kernel except the precompiled headers. System.h is still included in the generated DllConfig.h file, but all of its necessary functionality should have been pulled from System.h once everything else is ready. --- .../Kernel/inc/MantidKernel/ArrayProperty.h | 2 +- .../Kernel/inc/MantidKernel/BinaryFile.h | 2 +- .../inc/MantidKernel/BoundedValidator.h | 2 +- Framework/Kernel/inc/MantidKernel/Cache.h | 2 +- Framework/Kernel/inc/MantidKernel/Chainable.h | 4 +- .../inc/MantidKernel/ChainableFactory.h | 4 +- .../inc/MantidKernel/CompositeValidator.h | 2 +- .../Kernel/inc/MantidKernel/DataService.h | 2 +- .../Kernel/inc/MantidKernel/DiskBuffer.h | 2 +- .../Kernel/inc/MantidKernel/EmptyValues.h | 1 - .../inc/MantidKernel/EnabledWhenProperty.h | 2 +- .../MantidKernel/FilteredTimeSeriesProperty.h | 3 +- .../Kernel/inc/MantidKernel/FunctionTask.h | 2 +- Framework/Kernel/inc/MantidKernel/INode.h | 2 +- .../inc/MantidKernel/IPropertyManager.h | 2 +- .../Kernel/inc/MantidKernel/Instantiator.h | 5 +- .../Kernel/inc/MantidKernel/LambdaValidator.h | 2 +- Framework/Kernel/inc/MantidKernel/MDUnit.h | 2 +- .../Kernel/inc/MantidKernel/MDUnitFactory.h | 1 - Framework/Kernel/inc/MantidKernel/MRUList.h | 2 +- .../inc/MantidKernel/MandatoryValidator.h | 4 +- .../Math/Optimization/SLSQPMinimizer.h | 1 - .../NDPseudoRandomNumberGenerator.h | 2 +- .../inc/MantidKernel/NearestNeighbours.h | 2 +- .../Kernel/inc/MantidKernel/NetworkProxy.h | 2 +- .../Kernel/inc/MantidKernel/PropertyNexus.h | 10 +- .../inc/MantidKernel/PropertyWithValue.h | 2 +- .../inc/MantidKernel/StartsWithValidator.h | 4 +- .../MantidKernel/StringContainsValidator.h | 2 +- Framework/Kernel/inc/MantidKernel/Strings.h | 11 +-- .../inc/MantidKernel/ThreadSchedulerMutexes.h | 2 +- .../inc/MantidKernel/TimeSeriesProperty.h | 2 +- .../Kernel/inc/MantidKernel/TypedValidator.h | 5 +- Framework/Kernel/inc/MantidKernel/VMD.h | 2 +- .../inc/MantidKernel/VisibleWhenProperty.h | 2 +- .../inc/MantidKernel/normal_distribution.h | 6 +- Framework/Kernel/src/ArrayProperty.cpp | 38 ++++---- Framework/Kernel/src/ConfigObserver.cpp | 1 - Framework/Kernel/src/ConfigService.cpp | 11 +-- Framework/Kernel/src/DateTimeValidator.cpp | 1 - Framework/Kernel/src/Exception.cpp | 4 +- .../Kernel/src/FloatingPointComparison.cpp | 91 ++++++++++--------- Framework/Kernel/src/IPropertyManager.cpp | 4 +- Framework/Kernel/src/MandatoryValidator.cpp | 16 ++-- Framework/Kernel/src/Memory.cpp | 5 +- Framework/Kernel/src/RegexStrings.cpp | 30 +++--- Framework/Kernel/src/Statistics.cpp | 4 +- Framework/Kernel/src/VectorHelper.cpp | 19 ++-- .../CMake/CppCheck_Suppressions.txt.in | 2 +- .../CMake/GenerateMantidExportHeader.cmake | 13 ++- 50 files changed, 176 insertions(+), 168 deletions(-) diff --git a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h index eb7c4a047d4b..a456406c9792 100644 --- a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h +++ b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h @@ -25,7 +25,7 @@ namespace Kernel { @author Russell Taylor, Tessella Support Services plc @date 27/02/2008 */ -template class DLLExport ArrayProperty : public PropertyWithValue> { +template class MANTID_KERNEL_DLL ArrayProperty : public PropertyWithValue> { public: ArrayProperty(const std::string &name, std::vector vec, const IValidator_sptr &validator = IValidator_sptr(new NullValidator), diff --git a/Framework/Kernel/inc/MantidKernel/BinaryFile.h b/Framework/Kernel/inc/MantidKernel/BinaryFile.h index 7cc16f2db9e9..3fc7a4911d8b 100644 --- a/Framework/Kernel/inc/MantidKernel/BinaryFile.h +++ b/Framework/Kernel/inc/MantidKernel/BinaryFile.h @@ -40,7 +40,7 @@ static const size_t MIN_BLOCK_SIZE = 1000; * the T type is done with a reinterpret_cast. * */ -template class DLLExport BinaryFile { +template class MANTID_KERNEL_DLL BinaryFile { public: //------------------------------------------------------------------------------------ /// Empty constructor diff --git a/Framework/Kernel/inc/MantidKernel/BoundedValidator.h b/Framework/Kernel/inc/MantidKernel/BoundedValidator.h index 1ec079de6e1c..fe147d2e68b1 100644 --- a/Framework/Kernel/inc/MantidKernel/BoundedValidator.h +++ b/Framework/Kernel/inc/MantidKernel/BoundedValidator.h @@ -29,7 +29,7 @@ constexpr int LOWER_BOUND = -1; constexpr int UPPER_BOUND = 1; } // namespace -template class DLLExport BoundedValidator final : public TypedValidator { +template class MANTID_KERNEL_DLL BoundedValidator final : public TypedValidator { public: /// No-arg Constructor BoundedValidator() noexcept diff --git a/Framework/Kernel/inc/MantidKernel/Cache.h b/Framework/Kernel/inc/MantidKernel/Cache.h index 597798ecbfe4..41eae9a6e11f 100644 --- a/Framework/Kernel/inc/MantidKernel/Cache.h +++ b/Framework/Kernel/inc/MantidKernel/Cache.h @@ -24,7 +24,7 @@ Cache is a generic caching storage class. @author Nick Draper, Tessella Support Services plc @date 20/10/2009 */ -template class DLLExport Cache { +template class MANTID_KERNEL_DLL Cache { public: /// No-arg Constructor Cache() : m_cacheHit(0), m_cacheMiss(0), m_cacheMap(), m_mutex() {} diff --git a/Framework/Kernel/inc/MantidKernel/Chainable.h b/Framework/Kernel/inc/MantidKernel/Chainable.h index e0ca533aa29f..71772ddfbaf6 100644 --- a/Framework/Kernel/inc/MantidKernel/Chainable.h +++ b/Framework/Kernel/inc/MantidKernel/Chainable.h @@ -6,7 +6,7 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once -#include "MantidKernel/System.h" +#include "MantidKernel/DllConfig.h" #include #include @@ -28,7 +28,7 @@ Otherwise you could do this along the chain top to bottom. **/ -template class DLLExport Chainable { +template class MANTID_KERNEL_DLL Chainable { protected: /// Successor factory /// std::optional> m_successor; diff --git a/Framework/Kernel/inc/MantidKernel/ChainableFactory.h b/Framework/Kernel/inc/MantidKernel/ChainableFactory.h index 1b355866ca9d..0723b92ee83e 100644 --- a/Framework/Kernel/inc/MantidKernel/ChainableFactory.h +++ b/Framework/Kernel/inc/MantidKernel/ChainableFactory.h @@ -7,7 +7,7 @@ #pragma once #include "MantidKernel/Chainable.h" -#include "MantidKernel/System.h" +#include "MantidKernel/DllConfig.h" #include #include @@ -17,7 +17,7 @@ namespace Kernel { /** ChainableFactory : Chain of Responsiblity generic factory */ template -class DLLExport ChainableFactory : public Chainable { +class MANTID_KERNEL_DLL ChainableFactory : public Chainable { public: /** * Factory method wrapper. Wraps results in smart pointer. diff --git a/Framework/Kernel/inc/MantidKernel/CompositeValidator.h b/Framework/Kernel/inc/MantidKernel/CompositeValidator.h index 9c871e73c557..9e25c02eb75e 100644 --- a/Framework/Kernel/inc/MantidKernel/CompositeValidator.h +++ b/Framework/Kernel/inc/MantidKernel/CompositeValidator.h @@ -6,8 +6,8 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/IValidator.h" -#include "MantidKernel/System.h" #include diff --git a/Framework/Kernel/inc/MantidKernel/DataService.h b/Framework/Kernel/inc/MantidKernel/DataService.h index b67d87117b59..b74b348a9445 100644 --- a/Framework/Kernel/inc/MantidKernel/DataService.h +++ b/Framework/Kernel/inc/MantidKernel/DataService.h @@ -54,7 +54,7 @@ struct CaseInsensitiveCmp { through writing scripts or directly through the API. It is implemented as a singleton class. */ -template class DLLExport DataService { +template class MANTID_KERNEL_DLL DataService { private: /// Typedef for the map holding the names of and pointers to the data objects using svcmap = std::map, CaseInsensitiveCmp>; diff --git a/Framework/Kernel/inc/MantidKernel/DiskBuffer.h b/Framework/Kernel/inc/MantidKernel/DiskBuffer.h index 790bed4b084e..5b1cd3014fdb 100644 --- a/Framework/Kernel/inc/MantidKernel/DiskBuffer.h +++ b/Framework/Kernel/inc/MantidKernel/DiskBuffer.h @@ -6,8 +6,8 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/FreeBlock.h" -#include "MantidKernel/System.h" #ifndef Q_MOC_RUN #include #include diff --git a/Framework/Kernel/inc/MantidKernel/EmptyValues.h b/Framework/Kernel/inc/MantidKernel/EmptyValues.h index 78ce16fa75da..43cedba02be8 100644 --- a/Framework/Kernel/inc/MantidKernel/EmptyValues.h +++ b/Framework/Kernel/inc/MantidKernel/EmptyValues.h @@ -12,7 +12,6 @@ @author Martyn Gigg, Tessella plc */ #include "MantidKernel/DllConfig.h" -#include "MantidKernel/System.h" #include diff --git a/Framework/Kernel/inc/MantidKernel/EnabledWhenProperty.h b/Framework/Kernel/inc/MantidKernel/EnabledWhenProperty.h index dc8de43dcd48..2914a00bd673 100644 --- a/Framework/Kernel/inc/MantidKernel/EnabledWhenProperty.h +++ b/Framework/Kernel/inc/MantidKernel/EnabledWhenProperty.h @@ -6,8 +6,8 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/IPropertySettings.h" -#include "MantidKernel/System.h" #include #include diff --git a/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h b/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h index f3d85f357ca1..8c8b6d61dffd 100644 --- a/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h +++ b/Framework/Kernel/inc/MantidKernel/FilteredTimeSeriesProperty.h @@ -7,7 +7,6 @@ #pragma once #include "MantidKernel/DllConfig.h" -#include "MantidKernel/System.h" #include "MantidKernel/TimeSeriesProperty.h" namespace Mantid { @@ -20,7 +19,7 @@ class SplittingInterval; * Templated class that defines a filtered time series but * still gives access to the original data. */ -template class DLLExport FilteredTimeSeriesProperty : public TimeSeriesProperty { +template class MANTID_KERNEL_DLL FilteredTimeSeriesProperty : public TimeSeriesProperty { public: explicit FilteredTimeSeriesProperty(const std::string &name); diff --git a/Framework/Kernel/inc/MantidKernel/FunctionTask.h b/Framework/Kernel/inc/MantidKernel/FunctionTask.h index 6b22017c2e98..cc407436be84 100644 --- a/Framework/Kernel/inc/MantidKernel/FunctionTask.h +++ b/Framework/Kernel/inc/MantidKernel/FunctionTask.h @@ -28,7 +28,7 @@ namespace Kernel { * @author Janik Zikovsky, SNS * @date Feb 8, 2011 */ -class DLLExport FunctionTask final : public Task { +class MANTID_KERNEL_DLL FunctionTask final : public Task { public: /// Typedef for a function with no arguments and no return using voidFunction = void (*)(); diff --git a/Framework/Kernel/inc/MantidKernel/INode.h b/Framework/Kernel/inc/MantidKernel/INode.h index 49389a89e731..698b894a3b29 100644 --- a/Framework/Kernel/inc/MantidKernel/INode.h +++ b/Framework/Kernel/inc/MantidKernel/INode.h @@ -15,7 +15,7 @@ namespace Mantid { namespace Kernel { /** Helper class providing interface to ISAveable */ -class DLLExport INode { +class MANTID_KERNEL_DLL INode { public: virtual ~INode() {}; }; diff --git a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h index fb5129d18dfe..5256e6beef8e 100644 --- a/Framework/Kernel/inc/MantidKernel/IPropertyManager.h +++ b/Framework/Kernel/inc/MantidKernel/IPropertyManager.h @@ -525,7 +525,7 @@ class MANTID_KERNEL_DLL IPropertyManager { #define DEFINE_IPROPERTYMANAGER_GETVALUE(type) \ namespace Mantid { \ namespace Kernel { \ - template <> DLLExport type IPropertyManager::getValue(const std::string &name) const { \ + template <> MANTID_KERNEL_DLL type IPropertyManager::getValue(const std::string &name) const { \ PropertyWithValue *prop = dynamic_cast *>(getPointerToProperty(name)); \ if (prop) { \ return *prop; \ diff --git a/Framework/Kernel/inc/MantidKernel/Instantiator.h b/Framework/Kernel/inc/MantidKernel/Instantiator.h index a90717863688..73609a9f8f28 100644 --- a/Framework/Kernel/inc/MantidKernel/Instantiator.h +++ b/Framework/Kernel/inc/MantidKernel/Instantiator.h @@ -6,6 +6,7 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include namespace Mantid { @@ -20,7 +21,7 @@ namespace Kernel { @date 10/10/2007 */ template -class DLLExport AbstractInstantiator +class MANTID_KERNEL_DLL AbstractInstantiator /// The base class for instantiators { public: @@ -51,7 +52,7 @@ class DLLExport AbstractInstantiator // instances are to be instantiated must have a no-argument // constructor. template -class DLLExport Instantiator : public AbstractInstantiator { +class MANTID_KERNEL_DLL Instantiator : public AbstractInstantiator { public: /// Creates the Instantiator. Instantiator() = default; diff --git a/Framework/Kernel/inc/MantidKernel/LambdaValidator.h b/Framework/Kernel/inc/MantidKernel/LambdaValidator.h index 734a4ee82974..74bd94087f97 100644 --- a/Framework/Kernel/inc/MantidKernel/LambdaValidator.h +++ b/Framework/Kernel/inc/MantidKernel/LambdaValidator.h @@ -20,7 +20,7 @@ to extract the parameter type and then pass it to the vaildtor function. The function used for validation should accept one parameter, the variable to be validated, and returns an error string (empty string for no error). */ -template class DLLExport LambdaValidator : public TypedValidator { +template class MANTID_KERNEL_DLL LambdaValidator : public TypedValidator { using ValidatorFunction = std::function; public: diff --git a/Framework/Kernel/inc/MantidKernel/MDUnit.h b/Framework/Kernel/inc/MantidKernel/MDUnit.h index 46a120758a9c..14fc9a717e40 100644 --- a/Framework/Kernel/inc/MantidKernel/MDUnit.h +++ b/Framework/Kernel/inc/MantidKernel/MDUnit.h @@ -6,7 +6,7 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once -#include "MantidKernel/System.h" +#include "MantidKernel/DllConfig.h" #include "MantidKernel/UnitLabel.h" #include #include diff --git a/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h b/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h index 45c0298867b5..6573626d09ac 100644 --- a/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h +++ b/Framework/Kernel/inc/MantidKernel/MDUnitFactory.h @@ -9,7 +9,6 @@ #include "MantidKernel/ChainableFactory.h" #include "MantidKernel/DllConfig.h" #include "MantidKernel/MDUnit.h" -#include "MantidKernel/System.h" #include namespace Mantid { diff --git a/Framework/Kernel/inc/MantidKernel/MRUList.h b/Framework/Kernel/inc/MantidKernel/MRUList.h index 3c5a44615bb8..f35674f7b3cb 100644 --- a/Framework/Kernel/inc/MantidKernel/MRUList.h +++ b/Framework/Kernel/inc/MantidKernel/MRUList.h @@ -29,7 +29,7 @@ namespace Kernel { Boost.MultiIndex documentation () */ -template class DLLExport MRUList { +template class MANTID_KERNEL_DLL MRUList { private: /// hideous typedef for the container holding the list using item_list = typename boost::multi_index::multi_index_container< diff --git a/Framework/Kernel/inc/MantidKernel/MandatoryValidator.h b/Framework/Kernel/inc/MantidKernel/MandatoryValidator.h index 168641bd0c8e..532cce5ac9ea 100644 --- a/Framework/Kernel/inc/MantidKernel/MandatoryValidator.h +++ b/Framework/Kernel/inc/MantidKernel/MandatoryValidator.h @@ -14,7 +14,7 @@ namespace Mantid { namespace Kernel { namespace Detail { /// Forward declare checking function -template DLLExport bool checkIsEmpty(const T &); +template MANTID_KERNEL_DLL bool checkIsEmpty(const T &); /// Specialization for any vector type template bool checkIsEmpty(const std::vector &value) { return value.empty(); } @@ -40,7 +40,7 @@ template struct IsEmpty { @author Nick Draper, Tessella Support Services plc @date 28/11/2007 */ -template class DLLExport MandatoryValidator : public TypedValidator { +template class MANTID_KERNEL_DLL MandatoryValidator : public TypedValidator { public: IValidator_sptr clone() const override { return std::make_shared(); } diff --git a/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h b/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h index 92771551ec58..caa0f5a6a61f 100644 --- a/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h +++ b/Framework/Kernel/inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h @@ -8,7 +8,6 @@ #include "MantidKernel/DllConfig.h" #include "MantidKernel/Matrix.h" -#include "MantidKernel/System.h" #include diff --git a/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h b/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h index afa5e22c602c..2496143692cc 100644 --- a/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h +++ b/Framework/Kernel/inc/MantidKernel/NDPseudoRandomNumberGenerator.h @@ -26,7 +26,7 @@ namespace Kernel { * */ template -class DLLExport NDPseudoRandomNumberGenerator : public NDRandomNumberGenerator { +class MANTID_KERNEL_DLL NDPseudoRandomNumberGenerator : public NDRandomNumberGenerator { public: /// Constructor NDPseudoRandomNumberGenerator(const unsigned int ndims, const size_t seedValue); diff --git a/Framework/Kernel/inc/MantidKernel/NearestNeighbours.h b/Framework/Kernel/inc/MantidKernel/NearestNeighbours.h index 22217e79c254..bd7f07a3c877 100644 --- a/Framework/Kernel/inc/MantidKernel/NearestNeighbours.h +++ b/Framework/Kernel/inc/MantidKernel/NearestNeighbours.h @@ -81,7 +81,7 @@ class NNDataPoints { // NearestNeighbours implementation //------------------------------------------------------------------------------ -template class DLLExport NearestNeighbours { +template class MANTID_KERNEL_DLL NearestNeighbours { public: // typedefs for code brevity diff --git a/Framework/Kernel/inc/MantidKernel/NetworkProxy.h b/Framework/Kernel/inc/MantidKernel/NetworkProxy.h index a2154a077206..ce408f0add50 100644 --- a/Framework/Kernel/inc/MantidKernel/NetworkProxy.h +++ b/Framework/Kernel/inc/MantidKernel/NetworkProxy.h @@ -6,9 +6,9 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/Logger.h" #include "MantidKernel/ProxyInfo.h" -#include "MantidKernel/System.h" namespace Mantid { namespace Kernel { diff --git a/Framework/Kernel/inc/MantidKernel/PropertyNexus.h b/Framework/Kernel/inc/MantidKernel/PropertyNexus.h index b17af5f141e8..bf729784d2d9 100644 --- a/Framework/Kernel/inc/MantidKernel/PropertyNexus.h +++ b/Framework/Kernel/inc/MantidKernel/PropertyNexus.h @@ -6,8 +6,8 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/NexusHDF5Descriptor.h" -#include "MantidKernel/System.h" #include #include @@ -39,11 +39,11 @@ namespace PropertyNexus { * @param prefix indicates current group location in file (absolute name) * @return std::unique_ptr */ -DLLExport std::unique_ptr loadProperty(::NeXus::File *file, const std::string &group, - const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, - const std::string &prefix); +MANTID_KERNEL_DLL std::unique_ptr loadProperty(::NeXus::File *file, const std::string &group, + const Mantid::Kernel::NexusHDF5Descriptor &fileInfo, + const std::string &prefix); -DLLExport std::unique_ptr loadProperty(::NeXus::File *file, const std::string &group); +MANTID_KERNEL_DLL std::unique_ptr loadProperty(::NeXus::File *file, const std::string &group); } // namespace PropertyNexus diff --git a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h index a980869503c2..fce090d89396 100644 --- a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h +++ b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h @@ -34,7 +34,7 @@ namespace Kernel { http://proj-gaudi.web.cern.ch/proj-gaudi/) @date 14/11/2007 */ -template class DLLExport PropertyWithValue : public Property { +template class MANTID_KERNEL_DLL PropertyWithValue : public Property { public: PropertyWithValue(std::string name, TYPE defaultValue, IValidator_sptr validator = IValidator_sptr(new NullValidator), const unsigned int direction = Direction::Input); diff --git a/Framework/Kernel/inc/MantidKernel/StartsWithValidator.h b/Framework/Kernel/inc/MantidKernel/StartsWithValidator.h index c4b92895dc7d..c7151e0512cb 100644 --- a/Framework/Kernel/inc/MantidKernel/StartsWithValidator.h +++ b/Framework/Kernel/inc/MantidKernel/StartsWithValidator.h @@ -6,9 +6,9 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/IValidator.h" #include "MantidKernel/ListValidator.h" -#include "MantidKernel/System.h" #include #include #include @@ -19,7 +19,7 @@ namespace Kernel { start with one of the strings in a defined list of possibilities. */ -class DLLExport StartsWithValidator : public Kernel::StringListValidator { +class MANTID_KERNEL_DLL StartsWithValidator : public Kernel::StringListValidator { public: StartsWithValidator() = default; StartsWithValidator(const std::vector &values); diff --git a/Framework/Kernel/inc/MantidKernel/StringContainsValidator.h b/Framework/Kernel/inc/MantidKernel/StringContainsValidator.h index 48c3e40b142a..89537bad3302 100644 --- a/Framework/Kernel/inc/MantidKernel/StringContainsValidator.h +++ b/Framework/Kernel/inc/MantidKernel/StringContainsValidator.h @@ -6,7 +6,7 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once -#include "MantidKernel/System.h" +#include "MantidKernel/DllConfig.h" #include "MantidKernel/TypedValidator.h" namespace Mantid { diff --git a/Framework/Kernel/inc/MantidKernel/Strings.h b/Framework/Kernel/inc/MantidKernel/Strings.h index 90f7d8c58597..3b35753dbb76 100644 --- a/Framework/Kernel/inc/MantidKernel/Strings.h +++ b/Framework/Kernel/inc/MantidKernel/Strings.h @@ -12,7 +12,6 @@ #include "MantidKernel/DllConfig.h" #include "MantidKernel/MultiThreaded.h" #include "MantidKernel/StringTokenizer.h" -#include "MantidKernel/System.h" #ifndef Q_MOC_RUN #include @@ -50,7 +49,7 @@ namespace Strings { * @return */ template -DLLExport std::string simpleJoin(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator) { +MANTID_KERNEL_DLL std::string simpleJoin(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator) { std::ostringstream output; ITERATOR_TYPE it; for (it = begin; it != end;) { @@ -80,7 +79,7 @@ DLLExport std::string simpleJoin(ITERATOR_TYPE begin, ITERATOR_TYPE end, const s * @return */ template -DLLExport std::string +MANTID_KERNEL_DLL std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if::iterator_category, std::random_access_iterator_tag>::value)>::type * = nullptr) { @@ -107,7 +106,7 @@ join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, * @return */ template -DLLExport std::string +MANTID_KERNEL_DLL std::string join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, typename std::enable_if<(std::is_same::iterator_category, std::random_access_iterator_tag>::value)>::type * = nullptr) { @@ -193,8 +192,8 @@ join(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator, * @return A string with contiguous values compressed using the list syntax */ template -DLLExport std::string joinCompress(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator = ",", - const std::string &listSeparator = "-") { +MANTID_KERNEL_DLL std::string joinCompress(ITERATOR_TYPE begin, ITERATOR_TYPE end, const std::string &separator = ",", + const std::string &listSeparator = "-") { if (begin == end) { return ""; diff --git a/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h b/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h index 3b5421b0f934..cbc2bb10c6d8 100644 --- a/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h +++ b/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h @@ -33,7 +33,7 @@ namespace Kernel { * @author Janik Zikovsky * @date 2011-02-25 16:39:43.233991 */ -class DLLExport ThreadSchedulerMutexes : public ThreadScheduler { +class MANTID_KERNEL_DLL ThreadSchedulerMutexes : public ThreadScheduler { public: ThreadSchedulerMutexes() = default; diff --git a/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h b/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h index d18ef1c4fd6d..8b92807818dd 100644 --- a/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h +++ b/Framework/Kernel/inc/MantidKernel/TimeSeriesProperty.h @@ -139,7 +139,7 @@ template class TimeValueUnit { /** A specialised Property class for holding a series of time-value pairs. */ -template class DLLExport TimeSeriesProperty : public Property, public ITimeSeriesProperty { +template class MANTID_KERNEL_DLL TimeSeriesProperty : public Property, public ITimeSeriesProperty { public: /// Constructor explicit TimeSeriesProperty(const std::string &name); diff --git a/Framework/Kernel/inc/MantidKernel/TypedValidator.h b/Framework/Kernel/inc/MantidKernel/TypedValidator.h index d05f332cba7d..91414bde57ad 100644 --- a/Framework/Kernel/inc/MantidKernel/TypedValidator.h +++ b/Framework/Kernel/inc/MantidKernel/TypedValidator.h @@ -22,7 +22,7 @@ directly. A specialised type exists for std::shared_ptr types */ -template class DLLExport TypedValidator : public IValidator { +template class MANTID_KERNEL_DLL TypedValidator : public IValidator { protected: /// Override this function to check the validity of the type virtual std::string checkValidity(const HeldType &) const = 0; @@ -56,7 +56,8 @@ template class DLLExport TypedValidator : public IValidator * The advantage of this is that Validator types then don't have to match * their types exactly. */ -template class DLLExport TypedValidator> : public IValidator { +template +class MANTID_KERNEL_DLL TypedValidator> : public IValidator { /// Shared ptr type using ElementType_sptr = std::shared_ptr; diff --git a/Framework/Kernel/inc/MantidKernel/VMD.h b/Framework/Kernel/inc/MantidKernel/VMD.h index 7e90524920c9..4cb7799d062f 100644 --- a/Framework/Kernel/inc/MantidKernel/VMD.h +++ b/Framework/Kernel/inc/MantidKernel/VMD.h @@ -19,7 +19,7 @@ class V3D; @author Janik Zikovsky @date 2011-08-30 */ -template class DLLExport VMDBase { +template class MANTID_KERNEL_DLL VMDBase { public: VMDBase(); VMDBase(size_t nd); diff --git a/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h b/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h index 1ee804b389bb..24895c8f36c3 100644 --- a/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h +++ b/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h @@ -6,8 +6,8 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once +#include "MantidKernel/DllConfig.h" #include "MantidKernel/EnabledWhenProperty.h" -#include "MantidKernel/System.h" #include diff --git a/Framework/Kernel/inc/MantidKernel/normal_distribution.h b/Framework/Kernel/inc/MantidKernel/normal_distribution.h index ff8683ef6bb0..8521b84ddd27 100644 --- a/Framework/Kernel/inc/MantidKernel/normal_distribution.h +++ b/Framework/Kernel/inc/MantidKernel/normal_distribution.h @@ -6,7 +6,7 @@ // SPDX - License - Identifier: GPL - 3.0 + #pragma once -#include "MantidKernel/System.h" +#include "MantidKernel/DllConfig.h" #include "MantidKernel/WarningSuppressions.h" #include #include @@ -58,12 +58,12 @@ template class __save_flags { } }; -template class DLLExport normal_distribution { +template class MANTID_KERNEL_DLL normal_distribution { public: // types using result_type = _RealType; - class DLLExport param_type { + class MANTID_KERNEL_DLL param_type { result_type __mean_; result_type __stddev_; diff --git a/Framework/Kernel/src/ArrayProperty.cpp b/Framework/Kernel/src/ArrayProperty.cpp index 3d77b6929ad9..78eb8847ed32 100644 --- a/Framework/Kernel/src/ArrayProperty.cpp +++ b/Framework/Kernel/src/ArrayProperty.cpp @@ -98,27 +98,27 @@ template void ArrayProperty::visualStudioC4661Workaround() {} // export macro not needed for int32_t due to explicit specialization in header. template class ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; - -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; + +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; #if defined(_WIN32) || defined(__clang__) && defined(__APPLE__) -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty; -template class DLLExport ArrayProperty>; -template class DLLExport ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty; +template class MANTID_KERNEL_DLL ArrayProperty>; +template class MANTID_KERNEL_DLL ArrayProperty>; #endif /// @endcond diff --git a/Framework/Kernel/src/ConfigObserver.cpp b/Framework/Kernel/src/ConfigObserver.cpp index 2ed8ea434bef..a5f3cf919b69 100644 --- a/Framework/Kernel/src/ConfigObserver.cpp +++ b/Framework/Kernel/src/ConfigObserver.cpp @@ -6,7 +6,6 @@ // SPDX - License - Identifier: GPL - 3.0 + #include "MantidKernel/ConfigObserver.h" #include "MantidKernel/ConfigService.h" -#include "MantidKernel/System.h" namespace Mantid::Kernel { /** diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index 05d9df39d3ab..0cbb8aae5d72 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -19,7 +19,6 @@ #include "MantidKernel/StdoutChannel.h" #include "MantidKernel/StringTokenizer.h" #include "MantidKernel/Strings.h" -#include "MantidKernel/System.h" #include #include @@ -1934,12 +1933,12 @@ void ConfigServiceImpl::setLogLevel(std::string const &logLevel, bool quiet) { std::string ConfigServiceImpl::getLogLevel() { return g_log.getLevelName(); } /// \cond TEMPLATE -template DLLExport std::optional ConfigServiceImpl::getValue(const std::string &); -template DLLExport std::optional ConfigServiceImpl::getValue(const std::string &); -template DLLExport std::optional ConfigServiceImpl::getValue(const std::string &); -template DLLExport std::optional ConfigServiceImpl::getValue(const std::string &); +template MANTID_KERNEL_DLL std::optional ConfigServiceImpl::getValue(const std::string &); +template MANTID_KERNEL_DLL std::optional ConfigServiceImpl::getValue(const std::string &); +template MANTID_KERNEL_DLL std::optional ConfigServiceImpl::getValue(const std::string &); +template MANTID_KERNEL_DLL std::optional ConfigServiceImpl::getValue(const std::string &); #ifdef _MSC_VER -template DLLExport std::optional ConfigServiceImpl::getValue(const std::string &); +template MANTID_KERNEL_DLL std::optional ConfigServiceImpl::getValue(const std::string &); #endif /// \endcond TEMPLATE diff --git a/Framework/Kernel/src/DateTimeValidator.cpp b/Framework/Kernel/src/DateTimeValidator.cpp index 26218531669d..f43b29e73a84 100644 --- a/Framework/Kernel/src/DateTimeValidator.cpp +++ b/Framework/Kernel/src/DateTimeValidator.cpp @@ -6,7 +6,6 @@ // SPDX - License - Identifier: GPL - 3.0 + #include "MantidKernel/DateTimeValidator.h" #include "MantidKernel/DateAndTimeHelpers.h" -#include "MantidKernel/System.h" #include #include diff --git a/Framework/Kernel/src/Exception.cpp b/Framework/Kernel/src/Exception.cpp index d90edda84055..df1a165248b5 100644 --- a/Framework/Kernel/src/Exception.cpp +++ b/Framework/Kernel/src/Exception.cpp @@ -237,8 +237,8 @@ const char *MisMatch::what() const noexcept } /// \cond TEMPLATE -template class DLLExport MisMatch; -template class DLLExport MisMatch; +template class MANTID_KERNEL_DLL MisMatch; +template class MANTID_KERNEL_DLL MisMatch; /// \endcond TEMPLATE //------------------------- diff --git a/Framework/Kernel/src/FloatingPointComparison.cpp b/Framework/Kernel/src/FloatingPointComparison.cpp index 18e21ee0a5c8..69f78fa73d65 100644 --- a/Framework/Kernel/src/FloatingPointComparison.cpp +++ b/Framework/Kernel/src/FloatingPointComparison.cpp @@ -8,7 +8,6 @@ // Includes //----------------------------------------------------------------------------- #include "MantidKernel/FloatingPointComparison.h" -#include "MantidKernel/System.h" #include "MantidKernel/V3D.h" #include @@ -236,55 +235,57 @@ inline bool withinRelativeDifference(T const x, T const y, S const tolerance, MA ///@cond // Concrete instantiations -template DLLExport bool equals(double const, double const); -template DLLExport bool equals(float const, float const); -template DLLExport bool ltEquals(double const, double const); -template DLLExport bool ltEquals(float const, float const); -template DLLExport bool gtEquals(double const, double const); -template DLLExport bool gtEquals(float const, float const); +template MANTID_KERNEL_DLL bool equals(double const, double const); +template MANTID_KERNEL_DLL bool equals(float const, float const); +template MANTID_KERNEL_DLL bool ltEquals(double const, double const); +template MANTID_KERNEL_DLL bool ltEquals(float const, float const); +template MANTID_KERNEL_DLL bool gtEquals(double const, double const); +template MANTID_KERNEL_DLL bool gtEquals(float const, float const); // difference methods -template DLLExport double absoluteDifference(double const, double const); -template DLLExport float absoluteDifference(float const, float const); -template DLLExport double relativeDifference(double const, double const); -template DLLExport float relativeDifference(float const, float const); +template MANTID_KERNEL_DLL double absoluteDifference(double const, double const); +template MANTID_KERNEL_DLL float absoluteDifference(float const, float const); +template MANTID_KERNEL_DLL double relativeDifference(double const, double const); +template MANTID_KERNEL_DLL float relativeDifference(float const, float const); // within difference methods -- object and tolerance same -template DLLExport bool withinAbsoluteDifference(double const, double const, double const); -template DLLExport bool withinAbsoluteDifference(float const, float const, float const); -template DLLExport bool withinAbsoluteDifference(int const, int const, int const); -template DLLExport bool withinAbsoluteDifference(unsigned int const, unsigned int const, - unsigned int const); -template DLLExport bool withinAbsoluteDifference(long const, long const, long const); -template DLLExport bool withinAbsoluteDifference(long long const, long long const, long long const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(double const, double const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(float const, float const, float const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(int const, int const, int const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(unsigned int const, unsigned int const, + unsigned int const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(long const, long const, long const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(long long const, long long const, long long const); // -template DLLExport bool withinRelativeDifference(double const, double const, double const); -template DLLExport bool withinRelativeDifference(float const, float const, float const); -template DLLExport bool withinRelativeDifference(int const, int const, int const); -template DLLExport bool withinRelativeDifference(unsigned int const, unsigned int const, - unsigned int const); -template DLLExport bool withinRelativeDifference(long const, long const, long const); -template DLLExport bool withinRelativeDifference(long long const, long long const, long long const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(double const, double const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(float const, float const, float const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(int const, int const, int const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(unsigned int const, unsigned int const, + unsigned int const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(long const, long const, long const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(long long const, long long const, long long const); // within difference methods -- tolerance is double -template DLLExport bool withinAbsoluteDifference(float const, float const, double const); -template DLLExport bool withinAbsoluteDifference(int const, int const, double const); -template DLLExport bool withinAbsoluteDifference(unsigned int const, unsigned int const, - double const); -template DLLExport bool withinAbsoluteDifference(long const, long const, double const); -template DLLExport bool withinAbsoluteDifference(unsigned long const, unsigned long const, - double const); -template DLLExport bool withinAbsoluteDifference(long long const, long long const, double const); -template DLLExport bool withinAbsoluteDifference(unsigned long long const, - unsigned long long const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(float const, float const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(int const, int const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(unsigned int const, unsigned int const, + double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(long const, long const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(unsigned long const, + unsigned long const, double const); +template MANTID_KERNEL_DLL bool withinAbsoluteDifference(long long const, long long const, + double const); +template MANTID_KERNEL_DLL bool +withinAbsoluteDifference(unsigned long long const, unsigned long long const, double const); // -template DLLExport bool withinRelativeDifference(float const, float const, double const); -template DLLExport bool withinRelativeDifference(int const, int const, double const); -template DLLExport bool withinRelativeDifference(unsigned int const, unsigned int const, - double const); -template DLLExport bool withinRelativeDifference(long const, long const, double const); -template DLLExport bool withinRelativeDifference(unsigned long const, unsigned long const, - double const); -template DLLExport bool withinRelativeDifference(long long const, long long const, double const); -template DLLExport bool withinRelativeDifference(unsigned long long const, - unsigned long long const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(float const, float const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(int const, int const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(unsigned int const, unsigned int const, + double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(long const, long const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(unsigned long const, + unsigned long const, double const); +template MANTID_KERNEL_DLL bool withinRelativeDifference(long long const, long long const, + double const); +template MANTID_KERNEL_DLL bool +withinRelativeDifference(unsigned long long const, unsigned long long const, double const); ///@endcond } // namespace Mantid::Kernel diff --git a/Framework/Kernel/src/IPropertyManager.cpp b/Framework/Kernel/src/IPropertyManager.cpp index a13b8b6096bf..988bc4125444 100644 --- a/Framework/Kernel/src/IPropertyManager.cpp +++ b/Framework/Kernel/src/IPropertyManager.cpp @@ -33,11 +33,11 @@ namespace Mantid::Kernel { // assign to an existing string // via the getProperty() method, you can construct a local variable by saying, // e.g.: std::string s = getProperty("myProperty") -template <> DLLExport std::string IPropertyManager::getValue(const std::string &name) const { +template <> MANTID_KERNEL_DLL std::string IPropertyManager::getValue(const std::string &name) const { return getPropertyValue(name); } -template <> DLLExport Property *IPropertyManager::getValue(const std::string &name) const { +template <> MANTID_KERNEL_DLL Property *IPropertyManager::getValue(const std::string &name) const { return getPointerToProperty(name); } diff --git a/Framework/Kernel/src/MandatoryValidator.cpp b/Framework/Kernel/src/MandatoryValidator.cpp index d491efe2b321..967d6f2ebf35 100644 --- a/Framework/Kernel/src/MandatoryValidator.cpp +++ b/Framework/Kernel/src/MandatoryValidator.cpp @@ -18,25 +18,27 @@ namespace Mantid::Kernel::Detail { * @param value :: A string object * @return True if the string is considered empty */ -template <> DLLExport bool checkIsEmpty(const std::string &value) { return value.empty(); } +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const std::string &value) { return value.empty(); } /** * Specialization of checkIsEmpty for double values * @param value :: A double * @return True if the value is considered empty, see EmptyValues.h */ -template <> DLLExport bool checkIsEmpty(const double &value) { return std::fabs(value - Mantid::EMPTY_DBL()) < 1e-08; } +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const double &value) { + return std::fabs(value - Mantid::EMPTY_DBL()) < 1e-08; +} /** * Specialization of checkIsEmpty for int * @param value :: A int value * @return True if the value is considered empty, see EmptyValues.h */ -template <> DLLExport bool checkIsEmpty(const int &value) { return (value == Mantid::EMPTY_INT()); } +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const int &value) { return (value == Mantid::EMPTY_INT()); } /** * Specialization of checkIsEmpty for long * @param value :: A long value * @return True if the value is considered empty, see EmptyValues.h */ -template <> DLLExport bool checkIsEmpty(const long &value) { +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const long &value) { // 32 bit for Windows and Clang, 64 bit for GCC return (value == Mantid::EMPTY_LONG()); } @@ -46,12 +48,14 @@ template <> DLLExport bool checkIsEmpty(const long &value) { * @param value :: A int64_t value * @return True if the value is considered empty, see EmptyValues.h */ -template <> DLLExport bool checkIsEmpty(const int64_t &value) { return (value == Mantid::EMPTY_INT64()); } +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const int64_t &value) { return (value == Mantid::EMPTY_INT64()); } #endif /** * Specialization of checkIsEmpty for OptionalBool * @param value :: A long value * @return True if the value is considered empty, see EmptyValues.h */ -template <> DLLExport bool checkIsEmpty(const OptionalBool &value) { return (value.getValue() == OptionalBool::Unset); } +template <> MANTID_KERNEL_DLL bool checkIsEmpty(const OptionalBool &value) { + return (value.getValue() == OptionalBool::Unset); +} } // namespace Mantid::Kernel::Detail diff --git a/Framework/Kernel/src/Memory.cpp b/Framework/Kernel/src/Memory.cpp index fff4dfdb0599..78ac1ed31791 100644 --- a/Framework/Kernel/src/Memory.cpp +++ b/Framework/Kernel/src/Memory.cpp @@ -6,7 +6,6 @@ // SPDX - License - Identifier: GPL - 3.0 + #include "MantidKernel/Memory.h" #include "MantidKernel/Logger.h" -#include "MantidKernel/System.h" #include #include @@ -561,8 +560,8 @@ size_t MemoryStats::getCurrentRSS() const { } // -------------------------- concrete instantiations -template DLLExport string memToString(const uint32_t); -template DLLExport string memToString(const uint64_t); +template MANTID_KERNEL_DLL string memToString(const uint32_t); +template MANTID_KERNEL_DLL string memToString(const uint64_t); // To initialize the static class variable. std::mutex MemoryStats::mutexMemory; diff --git a/Framework/Kernel/src/RegexStrings.cpp b/Framework/Kernel/src/RegexStrings.cpp index 11867cc5727d..1ee4e3013695 100644 --- a/Framework/Kernel/src/RegexStrings.cpp +++ b/Framework/Kernel/src/RegexStrings.cpp @@ -256,7 +256,7 @@ template <> int StrSingleSplit(const std::string &text, const boost::regex &Re, @param Out :: string to place match @return count of line that matched (or zero on failure) */ -DLLExport int findPattern(std::istream &fh, const boost::regex &Re, std::string &Out) { +MANTID_KERNEL_DLL int findPattern(std::istream &fh, const boost::regex &Re, std::string &Out) { char ss[512]; // max of 512 boost::cmatch ans; @@ -304,7 +304,7 @@ template int findComp(std::istream &fh, const boost::regex &Re, T & @param Out :: component in ( ) expression must be first. @return count of line that matched (or zero on failure) */ -template <> DLLExport int findComp(std::istream &fh, const boost::regex &Re, std::string &Out) { +template <> MANTID_KERNEL_DLL int findComp(std::istream &fh, const boost::regex &Re, std::string &Out) { char ss[512]; // max of 512 boost::cmatch ans; @@ -323,23 +323,23 @@ template <> DLLExport int findComp(std::istream &fh, const boost::regex &Re, std /// \cond TEMPLATE -template DLLExport int StrFullCut(std::string &, const boost::regex &, std::string &, const int); -template DLLExport int StrFullCut(std::string &, const boost::regex &, int &, const int); -template DLLExport int StrFullCut(std::string &, const boost::regex &, double &, const int); +template MANTID_KERNEL_DLL int StrFullCut(std::string &, const boost::regex &, std::string &, const int); +template MANTID_KERNEL_DLL int StrFullCut(std::string &, const boost::regex &, int &, const int); +template MANTID_KERNEL_DLL int StrFullCut(std::string &, const boost::regex &, double &, const int); -template DLLExport int StrFullSplit(const std::string &, const boost::regex &, std::vector &); -template DLLExport int StrFullSplit(const std::string &, const boost::regex &, std::vector &); -template DLLExport int StrFullSplit(const std::string &, const boost::regex &, std::vector &); +template MANTID_KERNEL_DLL int StrFullSplit(const std::string &, const boost::regex &, std::vector &); +template MANTID_KERNEL_DLL int StrFullSplit(const std::string &, const boost::regex &, std::vector &); +template MANTID_KERNEL_DLL int StrFullSplit(const std::string &, const boost::regex &, std::vector &); -template DLLExport int StrSingleSplit(const std::string &, const boost::regex &, std::vector &); -template DLLExport int StrSingleSplit(const std::string &, const boost::regex &, std::vector &); +template MANTID_KERNEL_DLL int StrSingleSplit(const std::string &, const boost::regex &, std::vector &); +template MANTID_KERNEL_DLL int StrSingleSplit(const std::string &, const boost::regex &, std::vector &); -template DLLExport int StrComp(const char *, const boost::regex &, double &, const int); -template DLLExport int StrComp(const char *, const boost::regex &, int &, const int); -template DLLExport int StrComp(const std::string &, const boost::regex &, double &, const int); -template DLLExport int StrComp(const std::string &, const boost::regex &, int &, const int); +template MANTID_KERNEL_DLL int StrComp(const char *, const boost::regex &, double &, const int); +template MANTID_KERNEL_DLL int StrComp(const char *, const boost::regex &, int &, const int); +template MANTID_KERNEL_DLL int StrComp(const std::string &, const boost::regex &, double &, const int); +template MANTID_KERNEL_DLL int StrComp(const std::string &, const boost::regex &, int &, const int); -template DLLExport int findComp(std::istream &, const boost::regex &, int &); +template MANTID_KERNEL_DLL int findComp(std::istream &, const boost::regex &, int &); /// \endcond TEMPLATE diff --git a/Framework/Kernel/src/Statistics.cpp b/Framework/Kernel/src/Statistics.cpp index d638cba1beaa..0b2f481e0abd 100644 --- a/Framework/Kernel/src/Statistics.cpp +++ b/Framework/Kernel/src/Statistics.cpp @@ -208,14 +208,14 @@ template Statistics getStatistics(const vector &data, cons } /// Getting statistics of a string array should just give a bunch of NaNs -template <> DLLExport Statistics getStatistics(const vector &data, const unsigned int flags) { +template <> MANTID_KERNEL_DLL Statistics getStatistics(const vector &data, const unsigned int flags) { UNUSED_ARG(flags); UNUSED_ARG(data); return Statistics(); // default is all nan } /// Getting statistics of a boolean array should just give a bunch of NaNs -template <> DLLExport Statistics getStatistics(const vector &data, const unsigned int flags) { +template <> MANTID_KERNEL_DLL Statistics getStatistics(const vector &data, const unsigned int flags) { UNUSED_ARG(flags); UNUSED_ARG(data); return Statistics(); // default is all nan diff --git a/Framework/Kernel/src/VectorHelper.cpp b/Framework/Kernel/src/VectorHelper.cpp index abe5145ee909..02d83ddd3224 100644 --- a/Framework/Kernel/src/VectorHelper.cpp +++ b/Framework/Kernel/src/VectorHelper.cpp @@ -31,9 +31,10 @@ namespace Mantid::Kernel::VectorHelper { * @param[in] power the power in case of inverse power sum. Must be between 0 and 1 or is ignored. * @return The number of bin boundaries in the new axis **/ -int DLLExport createAxisFromRebinParams(const std::vector ¶ms, std::vector &xnew, - const bool resize_xnew, const bool full_bins_only, const double xMinHint, - const double xMaxHint, const bool useReverseLogarithmic, const double power) { +int MANTID_KERNEL_DLL createAxisFromRebinParams(const std::vector ¶ms, std::vector &xnew, + const bool resize_xnew, const bool full_bins_only, + const double xMinHint, const double xMaxHint, + const bool useReverseLogarithmic, const double power) { std::vector tmp; const std::vector &fullParams = [¶ms, &tmp, xMinHint, xMaxHint]() { if (params.size() == 1) { @@ -765,11 +766,11 @@ void smoothInRange(const std::vector &input, std::vector &output } /// Declare all version of this -template DLLExport std::vector splitStringIntoVector(std::string listString); -template DLLExport std::vector splitStringIntoVector(std::string listString); -template DLLExport std::vector splitStringIntoVector(std::string listString); -template DLLExport std::vector splitStringIntoVector(std::string listString); -template DLLExport std::vector splitStringIntoVector(std::string listString); -template DLLExport std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); +template MANTID_KERNEL_DLL std::vector splitStringIntoVector(std::string listString); } // namespace Mantid::Kernel::VectorHelper diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in index 303402501531..c4bb4a38b751 100644 --- a/buildconfig/CMake/CppCheck_Suppressions.txt.in +++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in @@ -51,7 +51,7 @@ constParameterPointer:${CMAKE_SOURCE_DIR}/Framework/Kernel/src/AttenuationProfil missingOverride:${CMAKE_SOURCE_DIR}/Framework/Kernel/inc/MantidKernel/GitHubApiHelper.h:26 uninitMemberVarPrivate:${CMAKE_SOURCE_DIR}/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h:93 returnByReference:${CMAKE_SOURCE_DIR}/Framework/Kernel/inc/MantidKernel/FacilityInfo.h:48 -knownConditionTrueFalse:${CMAKE_SOURCE_DIR}/Framework/Kernel/inc/MantidKernel/Strings.h:170 +knownConditionTrueFalse:${CMAKE_SOURCE_DIR}/Framework/Kernel/inc/MantidKernel/Strings.h:169 nullPointerRedundantCheck:${CMAKE_SOURCE_DIR}/Framework/Kernel/src/GitHubApiHelper.cpp:167 nullPointerRedundantCheck:${CMAKE_SOURCE_DIR}/Framework/Kernel/src/GitHubApiHelper.cpp:168 nullPointerRedundantCheck:${CMAKE_SOURCE_DIR}/Framework/Kernel/src/GitHubApiHelper.cpp:169 diff --git a/buildconfig/CMake/GenerateMantidExportHeader.cmake b/buildconfig/CMake/GenerateMantidExportHeader.cmake index 65f0aac249da..c8c30249ef93 100644 --- a/buildconfig/CMake/GenerateMantidExportHeader.cmake +++ b/buildconfig/CMake/GenerateMantidExportHeader.cmake @@ -40,13 +40,22 @@ function(GENERATE_MANTID_EXPORT_HEADER TARGET_LIBRARY GENERATE_EXTERN) if(GENERATE_EXTERN) set(CUSTOM "${CUSTOM}\ -// Use extern keyword in client code to suppress class template instantiation\n\ +// MantidKernel/System.h will be removed\n\ #include \"MantidKernel/System.h\"\n\n\ +// Use extern keyword in client code to suppress class template instantiation\n\ #ifdef ${TARGET_LIBRARY}_EXPORTS\n\ #define EXTERN_MANTID_${TARGET_NAME}\n\ #else\n\ +#ifdef WIN32\n\ +#define EXTERN_IMPORT extern\n\ +#elif defined(__GNUC__) && !defined(__clang__)\n\ +#define EXTERN_IMPORT extern\n\ +#else\n\ +#define EXTERN_IMPORT extern\n\ +#endif\n\ #define EXTERN_MANTID_${TARGET_NAME} EXTERN_IMPORT\n\ -#endif /* ${TARGET_LIBRARY}_EXPORTS*/\n\ +#endif /* ${TARGET_LIBRARY}_EXPORTS*/\n\n\ +#include " ) endif(GENERATE_EXTERN)