From 0a1a0e9df00f37a210b67a11cf8f99550cafeeaf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 25 Oct 2018 03:11:42 +0200 Subject: cleanups only --- compat/linkage-macros.hpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'compat') diff --git a/compat/linkage-macros.hpp b/compat/linkage-macros.hpp index ea82c395..dff9a34c 100644 --- a/compat/linkage-macros.hpp +++ b/compat/linkage-macros.hpp @@ -7,20 +7,18 @@ # define OTR_GENERIC_EXPORT __attribute__((dllexport, visibility ("default"))) # define OTR_GENERIC_IMPORT __attribute__((dllimport, visibility ("default"))) #else -# define OTR_GENERIC_EXPORT __attribute__ ((visibility ("default"))) -# define OTR_GENERIC_IMPORT +# define OTR_GENERIC_EXPORT __attribute__((visibility ("default"))) +# define OTR_GENERIC_IMPORT __attribute__((visibility ("default"))) #endif -#if defined __APPLE__ -# define OTR_TEMPLATE_IMPORT(x) //nothing -#else -# define OTR_TEMPLATE_IMPORT(x) extern template class OTR_GENERIC_IMPORT x +#if defined __APPLE__ || (defined __MINGW32__ && defined _WIN64) +# define OTR_NO_TMPL_INST // link failure on both targets #endif -#define OTR_TEMPLATE_EXPORT_(x) template class OTR_GENERIC_EXPORT x - -#if defined __APPLE__ -# define OTR_TEMPLATE_EXPORT(x) // nothing -#else /* does this _always_ work for binutils ELF? */ -# define OTR_TEMPLATE_EXPORT(x) OTR_TEMPLATE_EXPORT_(x) +#if defined OTR_NO_TMPL_INST +# define OTR_TEMPLATE_IMPORT(x) +# define OTR_TEMPLATE_EXPORT(x) +#else +# define OTR_TEMPLATE_IMPORT(x) extern template class OTR_GENERIC_IMPORT x; +# define OTR_TEMPLATE_EXPORT(x) template class OTR_GENERIC_EXPORT x; #endif -- cgit v1.2.3