summaryrefslogtreecommitdiffhomepage
path: root/compat/linkage-macros.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-10-25 03:11:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-10-25 03:11:42 +0200
commit0a1a0e9df00f37a210b67a11cf8f99550cafeeaf (patch)
tree35da3c9a2d6464025dc324647253966d4a63a351 /compat/linkage-macros.hpp
parenta4c9807acacc87f323f31d252a37c0ed2029ee5b (diff)
cleanups only
Diffstat (limited to 'compat/linkage-macros.hpp')
-rw-r--r--compat/linkage-macros.hpp22
1 files changed, 10 insertions, 12 deletions
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