From d903095d973922761071ea675f380f5c4c3cf2ad Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Mar 2017 23:48:20 +0100 Subject: options, compat: instantiate common templates in their .dll's --- options/value.cpp | 3 ++- options/value.hpp | 29 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'options') diff --git a/options/value.cpp b/options/value.cpp index 36e05dac..af0da89f 100644 --- a/options/value.cpp +++ b/options/value.cpp @@ -6,6 +6,7 @@ * notice appear in all copies. */ +#define OTR_OPTIONS_VALUE_TEMPLATE_UNIT #include "value.hpp" namespace options { @@ -32,4 +33,4 @@ namespace detail } } -} +} // ns options diff --git a/options/value.hpp b/options/value.hpp index 2021bd3e..84416a94 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -8,8 +8,11 @@ #pragma once -#include "connector.hpp" +#include "export.hpp" + +#include "compat/util.hpp" +#include "connector.hpp" #include "bundle.hpp" #include "slider.hpp" #include @@ -135,14 +138,14 @@ template using value_element_type_t = typename value_element_type template class value final : public base_value { -public: - using element_type = detail::value_element_type_t; - static bool is_equal(const QVariant& val1, const QVariant& val2) { return val1.value() == val2.value(); } +public: + using element_type = detail::value_element_type_t; + t operator=(const t& datum) { const element_type tmp = static_cast(datum); @@ -206,5 +209,19 @@ private: const t def; }; - -} +#ifdef OTR_OPTIONS_VALUE_TEMPLATE_UNIT +# define OTR_OPTIONS_VALUE_TEMPLATE_EXTERN +# define OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC OPENTRACK_OPTIONS_EXPORT +#else +# define OTR_OPTIONS_VALUE_TEMPLATE_EXTERN extern +# define OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC +#endif + +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value; +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value; +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value; +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value; +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value; +OTR_OPTIONS_VALUE_TEMPLATE_EXTERN template class OTR_OPTIONS_VALUE_TEMPLATE_DECLSPEC value>; + +} // ns options -- cgit v1.2.3