From 561b89409551119833acf7abbb77d4afd632a657 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 30 May 2018 07:21:23 +0200 Subject: compat/linkage: extern template works on GNU now --- compat/linkage-macros.hpp | 10 ++++++++-- compat/macros.hpp | 12 +++++------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'compat') diff --git a/compat/linkage-macros.hpp b/compat/linkage-macros.hpp index 9e71ac8c..967dfba9 100644 --- a/compat/linkage-macros.hpp +++ b/compat/linkage-macros.hpp @@ -11,5 +11,11 @@ # define OTR_GENERIC_IMPORT #endif -#define OTR_TEMPLATE_EXPORT template class OTR_GENERIC_EXPORT -#define OTR_TEMPLATE_IMPORT extern template class OTR_GENERIC_IMPORT +#define OTR_TEMPLATE_IMPORT(x) extern template class OTR_GENERIC_IMPORT x +#define OTR_TEMPLATE_EXPORT_(x) template class OTR_GENERIC_EXPORT x + +#if defined _MSC_VER +# define OTR_TEMPLATE_EXPORT OTR_TEMPLATE_EXPORT_ +#else +# define OTR_TEMPLATE_EXPORT OTR_TEMPLATE_EXPORT_ +#endif diff --git a/compat/macros.hpp b/compat/macros.hpp index c0bc66f4..01d9cd83 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -46,23 +46,21 @@ # define OTR_FUNNAME (__PRETTY_FUNCTION__) #endif +#if !defined PP_CAT +# define PP_CAT(x,y) PP_CAT1(x,y) +# define PP_CAT1(x,y) x##y +#endif + #if defined __cplusplus // from now only C++ macros -# define thunk(...) ([&]() { __VA_ARGS__; }) - #if defined _MSC_VER # define OTR_DEPRECATE(msg, decl, body) __declspec(deprecated(msg)) decl body #else # define OTR_DEPRECATE(msg, decl, body) decl body __attribute__((deprecated(msg))) #endif -#if !defined PP_CAT -# define PP_CAT(x,y) PP_CAT1(x,y) -# define PP_CAT1(x,y) x##y -#endif - namespace static_warning_detail { template struct test___132; -- cgit v1.2.3