From 7e0f1522acef45a55e193e27fb195f24c88d8540 Mon Sep 17 00:00:00 2001 From: klayoutmatthias Date: Mon, 1 Jan 2018 18:55:11 +0100 Subject: [PATCH] Windows build compatibility The issue is with "dllexport": previously, dllexport was present on exposed templates tool (= visibility(default) for gcc/clang). This ensured MacOS compatibility since then the typeinfo is corretly shared and dynamic_cast/typeid works. For Windows, the "dllexport" equivalent requires the template instantiations to be declared "external" which is a coding nightmare. The solution is to provide separate macros for real (non-specialized, not explicitly instantiated) templates (.._PUBLIC_TEMPLATE) which is defined as empty for Windows and "visiblity(default)" for gcc/clang. --- src/ant/ant/antCommon.h | 3 +++ src/buddies/src/bd/bdCommon.h | 3 +++ src/db/db/dbBox.h | 2 +- src/db/db/dbCommon.h | 3 +++ src/db/db/dbEdge.h | 2 +- src/db/db/dbEdgePair.h | 2 +- src/db/db/dbInstances.h | 2 ++ src/db/db/dbLayout.h | 2 +- src/db/db/dbPath.h | 2 ++ src/db/db/dbPoint.h | 2 +- src/db/db/dbPolygon.h | 6 ++++-- src/db/db/dbShapes.h | 2 +- src/db/db/dbText.h | 2 +- src/db/db/dbTrans.h | 12 ++++++------ src/db/db/dbVector.h | 2 +- src/drc/drc/drcCommon.h | 3 +++ src/edt/edt/edtCommon.h | 3 +++ src/ext/ext/extCommon.h | 3 +++ src/gsi/gsi/gsiClass.h | 10 +++++----- src/gsi/gsi/gsiCommon.h | 3 +++ src/gsi/gsi/gsiExpression.h | 2 +- src/gsi/gsi/gsiSerialisation.h | 14 +++++++------- src/gsi/gsi/gsiTypes.h | 10 +++++----- src/img/img/imgCommon.h | 3 +++ src/lay/lay/layCommon.h | 3 +++ src/laybasic/laybasic/laybasicCommon.h | 3 +++ src/lib/lib/libCommon.h | 5 ++++- src/lym/lym/lymCommon.h | 3 +++ src/pya/pya/pyaCommon.h | 3 +++ src/pyastub/pyaCommon.h | 3 +++ src/rba/rba/rbaCommon.h | 3 +++ src/rbastub/rbaCommon.h | 3 +++ src/rdb/rdb/rdbCommon.h | 3 +++ src/tl/tl/tlCommon.h | 6 ++++++ src/tl/tl/tlEvents.h | 12 ++++++------ src/tl/tl/tlEventsVar.h | 12 ++++++------ src/tl/tl/tlObject.h | 6 +++--- src/tl/tl/tlVariant.h | 4 ++-- src/tl/tl/tlXMLParser.h | 12 ++++++------ 39 files changed, 121 insertions(+), 58 deletions(-) diff --git a/src/ant/ant/antCommon.h b/src/ant/ant/antCommon.h index 93991d9b4..79a085fb6 100644 --- a/src/ant/ant/antCommon.h +++ b/src/ant/ant/antCommon.h @@ -32,14 +32,17 @@ # define ANT_PUBLIC __declspec(dllimport) # endif # define ANT_LOCAL +# define ANT_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define ANT_PUBLIC __attribute__ ((visibility ("default"))) +# define ANT_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define ANT_LOCAL __attribute__ ((visibility ("hidden"))) # else # define ANT_PUBLIC +# define ANT_PUBLIC_TEMPLATE # define ANT_LOCAL # endif diff --git a/src/buddies/src/bd/bdCommon.h b/src/buddies/src/bd/bdCommon.h index 33fd0c01e..1f42ce820 100644 --- a/src/buddies/src/bd/bdCommon.h +++ b/src/buddies/src/bd/bdCommon.h @@ -32,14 +32,17 @@ # define BD_PUBLIC __declspec(dllimport) # endif # define BD_LOCAL +# define BD_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define BD_PUBLIC __attribute__ ((visibility ("default"))) +# define BD_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define BD_LOCAL __attribute__ ((visibility ("hidden"))) # else # define BD_PUBLIC +# define BD_PUBLIC_TEMPLATE # define BD_LOCAL # endif diff --git a/src/db/db/dbBox.h b/src/db/db/dbBox.h index 2a95b9f90..1f81df467 100644 --- a/src/db/db/dbBox.h +++ b/src/db/db/dbBox.h @@ -57,7 +57,7 @@ class ArrayRepository; */ template -struct DB_PUBLIC box +struct DB_PUBLIC_TEMPLATE box { typedef C coord_type; typedef box box_type; diff --git a/src/db/db/dbCommon.h b/src/db/db/dbCommon.h index 5d31d991c..e659f2a59 100644 --- a/src/db/db/dbCommon.h +++ b/src/db/db/dbCommon.h @@ -32,14 +32,17 @@ # define DB_PUBLIC __declspec(dllimport) # endif # define DB_LOCAL +# define DB_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define DB_PUBLIC __attribute__ ((visibility ("default"))) +# define DB_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define DB_LOCAL __attribute__ ((visibility ("hidden"))) # else # define DB_PUBLIC +# define DB_PUBLIC_TEMPLATE # define DB_LOCAL # endif diff --git a/src/db/db/dbEdge.h b/src/db/db/dbEdge.h index 91f866935..b2a623ed6 100644 --- a/src/db/db/dbEdge.h +++ b/src/db/db/dbEdge.h @@ -42,7 +42,7 @@ template class generic_repository; class ArrayRepository; template -class DB_PUBLIC edge +class DB_PUBLIC_TEMPLATE edge { public: typedef C coord_type; diff --git a/src/db/db/dbEdgePair.h b/src/db/db/dbEdgePair.h index e00f91bdf..80eb72f68 100644 --- a/src/db/db/dbEdgePair.h +++ b/src/db/db/dbEdgePair.h @@ -40,7 +40,7 @@ namespace db { template -class DB_PUBLIC edge_pair +class DB_PUBLIC_TEMPLATE edge_pair { public: typedef C coord_type; diff --git a/src/db/db/dbInstances.h b/src/db/db/dbInstances.h index 9e17f1e3b..e1c85e516 100644 --- a/src/db/db/dbInstances.h +++ b/src/db/db/dbInstances.h @@ -509,6 +509,8 @@ private: * determines how to initialize the iterators and what types to use. */ +// NOTE: we do explicit instantiation, so the exposure is declared +// as DB_PUBLIC - as if it wasn't a template template class DB_PUBLIC instance_iterator { diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h index 30bf84507..ac38acc6c 100644 --- a/src/db/db/dbLayout.h +++ b/src/db/db/dbLayout.h @@ -69,7 +69,7 @@ typedef generic_repository GenericRepository; * Since we are using a custom cell list, we have to provide our own iterator */ template -class DB_PUBLIC cell_list_iterator +class DB_PUBLIC_TEMPLATE cell_list_iterator { public: typedef C cell_type; diff --git a/src/db/db/dbPath.h b/src/db/db/dbPath.h index 34f8fe53b..2f8cfabb1 100644 --- a/src/db/db/dbPath.h +++ b/src/db/db/dbPath.h @@ -207,6 +207,8 @@ private: * The path can be converted to a polygon. */ +// NOTE: we do explicit instantiation, so the exposure is declared +// as DB_PUBLIC - as if it wasn't a template template class DB_PUBLIC path { diff --git a/src/db/db/dbPoint.h b/src/db/db/dbPoint.h index 4d07d0ea6..137053d1e 100644 --- a/src/db/db/dbPoint.h +++ b/src/db/db/dbPoint.h @@ -43,7 +43,7 @@ template class vector; */ template -class DB_PUBLIC point +class DB_PUBLIC_TEMPLATE point { public: typedef C coord_type; diff --git a/src/db/db/dbPolygon.h b/src/db/db/dbPolygon.h index 27c22ecbe..170d19e63 100644 --- a/src/db/db/dbPolygon.h +++ b/src/db/db/dbPolygon.h @@ -83,6 +83,8 @@ inline bool default_compression () * hull and holes respectively. */ +// NOTE: we do explicit instantiation, so the exposure is declared +// as DB_PUBLIC - as if it wasn't a template template class DB_PUBLIC polygon_contour { @@ -1364,7 +1366,7 @@ private: */ template -class DB_PUBLIC polygon +class DB_PUBLIC_TEMPLATE polygon { public: typedef C coord_type; @@ -2324,7 +2326,7 @@ private: */ template -class DB_PUBLIC simple_polygon +class DB_PUBLIC_TEMPLATE simple_polygon { public: typedef C coord_type; diff --git a/src/db/db/dbShapes.h b/src/db/db/dbShapes.h index bed170f61..fd842fc2b 100644 --- a/src/db/db/dbShapes.h +++ b/src/db/db/dbShapes.h @@ -1593,7 +1593,7 @@ public: * into the db::Object manager's undo/redo queue. */ template -class DB_PUBLIC layer_op +class DB_PUBLIC_TEMPLATE layer_op : public LayerOpBase { public: diff --git a/src/db/db/dbText.h b/src/db/db/dbText.h index 598742575..9b41d6681 100644 --- a/src/db/db/dbText.h +++ b/src/db/db/dbText.h @@ -222,7 +222,7 @@ private: */ template -class DB_PUBLIC text +class DB_PUBLIC_TEMPLATE text { public: typedef C coord_type; diff --git a/src/db/db/dbTrans.h b/src/db/db/dbTrans.h index 21bf9d763..fa8949910 100644 --- a/src/db/db/dbTrans.h +++ b/src/db/db/dbTrans.h @@ -42,10 +42,10 @@ namespace tl { namespace db { -template class DB_PUBLIC complex_trans; -template class DB_PUBLIC simple_trans; -template class disp_trans; -template class fixpoint_trans; +template class DB_PUBLIC_TEMPLATE complex_trans; +template class DB_PUBLIC_TEMPLATE simple_trans; +template class DB_PUBLIC_TEMPLATE disp_trans; +template class DB_PUBLIC_TEMPLATE fixpoint_trans; /** * @brief Provide the default predicates and properties for transformations for the coordinate type C @@ -1035,7 +1035,7 @@ operator<< (std::ostream &os, const disp_trans &t) */ template -class DB_PUBLIC simple_trans +class DB_PUBLIC_TEMPLATE simple_trans : public fixpoint_trans { public: @@ -1439,7 +1439,7 @@ operator<< (std::ostream &os, const simple_trans &t) * type used internally for representing the floating-point members). */ template -class DB_PUBLIC complex_trans +class DB_PUBLIC_TEMPLATE complex_trans { public: typedef I coord_type; diff --git a/src/db/db/dbVector.h b/src/db/db/dbVector.h index 69411553b..b5e15530b 100644 --- a/src/db/db/dbVector.h +++ b/src/db/db/dbVector.h @@ -45,7 +45,7 @@ template class point; */ template -class DB_PUBLIC vector +class DB_PUBLIC_TEMPLATE vector { public: typedef C coord_type; diff --git a/src/drc/drc/drcCommon.h b/src/drc/drc/drcCommon.h index be76a31dd..90afe36b4 100644 --- a/src/drc/drc/drcCommon.h +++ b/src/drc/drc/drcCommon.h @@ -32,14 +32,17 @@ # define DRC_PUBLIC __declspec(dllimport) # endif # define DRC_LOCAL +# define DRC_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define DRC_PUBLIC __attribute__ ((visibility ("default"))) +# define DRC_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define DRC_LOCAL __attribute__ ((visibility ("hidden"))) # else # define DRC_PUBLIC +# define DRC_PUBLIC_TEMPLATE # define DRC_LOCAL # endif diff --git a/src/edt/edt/edtCommon.h b/src/edt/edt/edtCommon.h index 9bdda5552..e0c36b6f5 100644 --- a/src/edt/edt/edtCommon.h +++ b/src/edt/edt/edtCommon.h @@ -32,14 +32,17 @@ # define EDT_PUBLIC __declspec(dllimport) # endif # define EDT_LOCAL +# define EDT_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define EDT_PUBLIC __attribute__ ((visibility ("default"))) +# define EDT_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define EDT_LOCAL __attribute__ ((visibility ("hidden"))) # else # define EDT_PUBLIC +# define EDT_PUBLIC_TEMPLATE # define EDT_LOCAL # endif diff --git a/src/ext/ext/extCommon.h b/src/ext/ext/extCommon.h index 3c05d13ee..2aeacc6a7 100644 --- a/src/ext/ext/extCommon.h +++ b/src/ext/ext/extCommon.h @@ -32,14 +32,17 @@ # define EXT_PUBLIC __declspec(dllimport) # endif # define EXT_LOCAL +# define EXT_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define EXT_PUBLIC __attribute__ ((visibility ("default"))) +# define EXT_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define EXT_LOCAL __attribute__ ((visibility ("hidden"))) # else # define EXT_PUBLIC +# define EXT_PUBLIC_TEMPLATE # define EXT_LOCAL # endif diff --git a/src/gsi/gsi/gsiClass.h b/src/gsi/gsi/gsiClass.h index 600c85abc..e6dfaba1d 100644 --- a/src/gsi/gsi/gsiClass.h +++ b/src/gsi/gsi/gsiClass.h @@ -116,7 +116,7 @@ void _var_user_read_impl (T * /*a*/, tl::Extractor & /*ex*/, tl::false_tag) * @brief A VariantUserClassBase specialization that links GSI classes and Variant classes */ template -class GSI_PUBLIC VariantUserClass +class GSI_PUBLIC_TEMPLATE VariantUserClass : public tl::VariantUserClass, private VariantUserClassImpl { public: @@ -551,7 +551,7 @@ public: * the given methods. */ template -class GSI_PUBLIC ClassExt +class GSI_PUBLIC_TEMPLATE ClassExt : public ClassBase { public: @@ -708,7 +708,7 @@ struct adaptor_type_info * or to call it's methods in some generic way. */ template -class GSI_PUBLIC Class +class GSI_PUBLIC_TEMPLATE Class : public ClassBase { public: @@ -937,7 +937,7 @@ public: * a subclass of the parent. */ template -class GSI_PUBLIC ChildClass +class GSI_PUBLIC_TEMPLATE ChildClass : public Class { public: @@ -970,7 +970,7 @@ public: * a subclass of the parent. */ template -class GSI_PUBLIC ChildSubClass +class GSI_PUBLIC_TEMPLATE ChildSubClass : public SubClass { public: diff --git a/src/gsi/gsi/gsiCommon.h b/src/gsi/gsi/gsiCommon.h index 2b83715cc..1cc488adb 100644 --- a/src/gsi/gsi/gsiCommon.h +++ b/src/gsi/gsi/gsiCommon.h @@ -32,14 +32,17 @@ # define GSI_PUBLIC __declspec(dllimport) # endif # define GSI_LOCAL +# define GSI_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define GSI_PUBLIC __attribute__ ((visibility ("default"))) +# define GSI_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define GSI_LOCAL __attribute__ ((visibility ("hidden"))) # else # define GSI_PUBLIC +# define GSI_PUBLIC_TEMPLATE # define GSI_LOCAL # endif diff --git a/src/gsi/gsi/gsiExpression.h b/src/gsi/gsi/gsiExpression.h index b7b63a11a..0ecf5c0ad 100644 --- a/src/gsi/gsi/gsiExpression.h +++ b/src/gsi/gsi/gsiExpression.h @@ -36,7 +36,7 @@ namespace gsi class GSI_PUBLIC ClassBase; struct NoAdaptorTag; -template class GSI_PUBLIC Class; +template class GSI_PUBLIC_TEMPLATE Class; /** * @brief The implementation delegate for the VariantUserClass diff --git a/src/gsi/gsi/gsiSerialisation.h b/src/gsi/gsi/gsiSerialisation.h index 5a2bbad28..d936d244c 100644 --- a/src/gsi/gsi/gsiSerialisation.h +++ b/src/gsi/gsi/gsiSerialisation.h @@ -650,7 +650,7 @@ public: * @brief Generic string adaptor implementation */ template -class GSI_PUBLIC StringAdaptorImpl +class GSI_PUBLIC_TEMPLATE StringAdaptorImpl : public StringAdaptor { }; @@ -945,7 +945,7 @@ private: * @brief Specialization for const unsigned char * */ template -class GSI_PUBLIC StringAdaptorImplCCP +class GSI_PUBLIC_TEMPLATE StringAdaptorImplCCP : public StringAdaptor { public: @@ -1103,7 +1103,7 @@ public: * @brief Generic string adaptor implementation */ template -class GSI_PUBLIC VariantAdaptorImpl +class GSI_PUBLIC_TEMPLATE VariantAdaptorImpl : public VariantAdaptor { }; @@ -1359,7 +1359,7 @@ public: * @brief Implementation of the generic iterator adaptor for a specific container */ template -class GSI_PUBLIC VectorAdaptorIteratorImpl +class GSI_PUBLIC_TEMPLATE VectorAdaptorIteratorImpl : public VectorAdaptorIterator { public: @@ -1434,7 +1434,7 @@ void push_vector (QSet &v, const X &x) * @brief Implementation of the generic adaptor for a specific container */ template -class GSI_PUBLIC VectorAdaptorImpl +class GSI_PUBLIC_TEMPLATE VectorAdaptorImpl : public VectorAdaptor { public: @@ -1709,7 +1709,7 @@ struct map_access > * @brief Implementation of the generic iterator adaptor for a specific container */ template -class GSI_PUBLIC MapAdaptorIteratorImpl +class GSI_PUBLIC_TEMPLATE MapAdaptorIteratorImpl : public MapAdaptorIterator { public: @@ -1745,7 +1745,7 @@ private: * @brief Implementation of the generic adaptor for a specific container */ template -class GSI_PUBLIC MapAdaptorImpl +class GSI_PUBLIC_TEMPLATE MapAdaptorImpl : public MapAdaptor { public: diff --git a/src/gsi/gsi/gsiTypes.h b/src/gsi/gsi/gsiTypes.h index 64a46a93b..4e3d04702 100644 --- a/src/gsi/gsi/gsiTypes.h +++ b/src/gsi/gsi/gsiTypes.h @@ -62,12 +62,12 @@ class GSI_PUBLIC StringAdaptor; class GSI_PUBLIC VariantAdaptor; class GSI_PUBLIC ClassBase; struct NoAdaptorTag; -template class GSI_PUBLIC Class; +template class GSI_PUBLIC_TEMPLATE Class; template struct ClassTag; -template class GSI_PUBLIC IterAdaptor; -template class GSI_PUBLIC IterPtrAdaptor; -template class GSI_PUBLIC ConstIterPtrAdaptor; -template class GSI_PUBLIC FreeIterAdaptor; +template class GSI_PUBLIC_TEMPLATE IterAdaptor; +template class GSI_PUBLIC_TEMPLATE IterPtrAdaptor; +template class GSI_PUBLIC_TEMPLATE ConstIterPtrAdaptor; +template class GSI_PUBLIC_TEMPLATE FreeIterAdaptor; template const ClassBase *cls_decl (); /** diff --git a/src/img/img/imgCommon.h b/src/img/img/imgCommon.h index 411442a14..d2f17615b 100644 --- a/src/img/img/imgCommon.h +++ b/src/img/img/imgCommon.h @@ -32,14 +32,17 @@ # define IMG_PUBLIC __declspec(dllimport) # endif # define IMG_LOCAL +# define IMG_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define IMG_PUBLIC __attribute__ ((visibility ("default"))) +# define IMG_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define IMG_LOCAL __attribute__ ((visibility ("hidden"))) # else # define IMG_PUBLIC +# define IMG_PUBLIC_TEMPLATE # define IMG_LOCAL # endif diff --git a/src/lay/lay/layCommon.h b/src/lay/lay/layCommon.h index b4ae166ab..1112de808 100644 --- a/src/lay/lay/layCommon.h +++ b/src/lay/lay/layCommon.h @@ -32,14 +32,17 @@ # define LAY_PUBLIC __declspec(dllimport) # endif # define LAY_LOCAL +# define LAY_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define LAY_PUBLIC __attribute__ ((visibility ("default"))) +# define LAY_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define LAY_LOCAL __attribute__ ((visibility ("hidden"))) # else # define LAY_PUBLIC +# define LAY_PUBLIC_TEMPLATE # define LAY_LOCAL # endif diff --git a/src/laybasic/laybasic/laybasicCommon.h b/src/laybasic/laybasic/laybasicCommon.h index 18cc3946c..a0351b3d4 100644 --- a/src/laybasic/laybasic/laybasicCommon.h +++ b/src/laybasic/laybasic/laybasicCommon.h @@ -32,14 +32,17 @@ # define LAYBASIC_PUBLIC __declspec(dllimport) # endif # define LAYBASIC_LOCAL +# define LAYBASIC_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define LAYBASIC_PUBLIC __attribute__ ((visibility ("default"))) +# define LAYBASIC_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define LAYBASIC_LOCAL __attribute__ ((visibility ("hidden"))) # else # define LAYBASIC_PUBLIC +# define LAYBASIC_PUBLIC_TEMPLATE # define LAYBASIC_LOCAL # endif diff --git a/src/lib/lib/libCommon.h b/src/lib/lib/libCommon.h index e3fdea003..7af1e33c0 100644 --- a/src/lib/lib/libCommon.h +++ b/src/lib/lib/libCommon.h @@ -32,14 +32,17 @@ # define LIB_PUBLIC __declspec(dllimport) # endif # define LIB_LOCAL +# define LIB_PUBLIC_TEMPLATE # else -# if __GNUC__ >= 4 +# if __GNUC__ >= 4 || defined(__clang__) # define LIB_PUBLIC __attribute__ ((visibility ("default"))) +# define LIB_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define LIB_LOCAL __attribute__ ((visibility ("hidden"))) # else # define LIB_PUBLIC +# define LIB_PUBLIC_TEMPLATE # define LIB_LOCAL # endif diff --git a/src/lym/lym/lymCommon.h b/src/lym/lym/lymCommon.h index 3465ff4f4..60e6f4c3f 100644 --- a/src/lym/lym/lymCommon.h +++ b/src/lym/lym/lymCommon.h @@ -32,14 +32,17 @@ # define LYM_PUBLIC __declspec(dllimport) # endif # define LYM_LOCAL +# define LYM_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define LYM_PUBLIC __attribute__ ((visibility ("default"))) +# define LYM_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define LYM_LOCAL __attribute__ ((visibility ("hidden"))) # else # define LYM_PUBLIC +# define LYM_PUBLIC_TEMPLATE # define LYM_LOCAL # endif diff --git a/src/pya/pya/pyaCommon.h b/src/pya/pya/pyaCommon.h index 8af7f41ee..54170edbd 100644 --- a/src/pya/pya/pyaCommon.h +++ b/src/pya/pya/pyaCommon.h @@ -32,14 +32,17 @@ # define PYA_PUBLIC __declspec(dllimport) # endif # define PYA_LOCAL +# define PYA_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define PYA_PUBLIC __attribute__ ((visibility ("default"))) +# define PYA_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define PYA_LOCAL __attribute__ ((visibility ("hidden"))) # else # define PYA_PUBLIC +# define PYA_PUBLIC_TEMPLATE # define PYA_LOCAL # endif diff --git a/src/pyastub/pyaCommon.h b/src/pyastub/pyaCommon.h index 8af7f41ee..54170edbd 100644 --- a/src/pyastub/pyaCommon.h +++ b/src/pyastub/pyaCommon.h @@ -32,14 +32,17 @@ # define PYA_PUBLIC __declspec(dllimport) # endif # define PYA_LOCAL +# define PYA_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define PYA_PUBLIC __attribute__ ((visibility ("default"))) +# define PYA_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define PYA_LOCAL __attribute__ ((visibility ("hidden"))) # else # define PYA_PUBLIC +# define PYA_PUBLIC_TEMPLATE # define PYA_LOCAL # endif diff --git a/src/rba/rba/rbaCommon.h b/src/rba/rba/rbaCommon.h index 60510c739..276219b2e 100644 --- a/src/rba/rba/rbaCommon.h +++ b/src/rba/rba/rbaCommon.h @@ -32,14 +32,17 @@ # define RBA_PUBLIC __declspec(dllimport) # endif # define RBA_LOCAL +# define RBA_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define RBA_PUBLIC __attribute__ ((visibility ("default"))) +# define RBA_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define RBA_LOCAL __attribute__ ((visibility ("hidden"))) # else # define RBA_PUBLIC +# define RBA_PUBLIC_TEMPLATE # define RBA_LOCAL # endif diff --git a/src/rbastub/rbaCommon.h b/src/rbastub/rbaCommon.h index 60510c739..276219b2e 100644 --- a/src/rbastub/rbaCommon.h +++ b/src/rbastub/rbaCommon.h @@ -32,14 +32,17 @@ # define RBA_PUBLIC __declspec(dllimport) # endif # define RBA_LOCAL +# define RBA_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define RBA_PUBLIC __attribute__ ((visibility ("default"))) +# define RBA_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define RBA_LOCAL __attribute__ ((visibility ("hidden"))) # else # define RBA_PUBLIC +# define RBA_PUBLIC_TEMPLATE # define RBA_LOCAL # endif diff --git a/src/rdb/rdb/rdbCommon.h b/src/rdb/rdb/rdbCommon.h index 7cec4f6ed..efaad5b7b 100644 --- a/src/rdb/rdb/rdbCommon.h +++ b/src/rdb/rdb/rdbCommon.h @@ -32,14 +32,17 @@ # define RDB_PUBLIC __declspec(dllimport) # endif # define RDB_LOCAL +# define RDB_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define RDB_PUBLIC __attribute__ ((visibility ("default"))) +# define RDB_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define RDB_LOCAL __attribute__ ((visibility ("hidden"))) # else # define RDB_PUBLIC +# define RDB_PUBLIC_TEMPLATE # define RDB_LOCAL # endif diff --git a/src/tl/tl/tlCommon.h b/src/tl/tl/tlCommon.h index 7a6d202ee..77ae0a144 100644 --- a/src/tl/tl/tlCommon.h +++ b/src/tl/tl/tlCommon.h @@ -32,14 +32,17 @@ # define TL_PUBLIC __declspec(dllimport) # endif # define TL_LOCAL +# define TL_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define TL_PUBLIC __attribute__ ((visibility ("default"))) +# define TL_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define TL_LOCAL __attribute__ ((visibility ("hidden"))) # else # define TL_PUBLIC +# define TL_PUBLIC_TEMPLATE # define TL_LOCAL # endif @@ -56,14 +59,17 @@ # define GSI_PUBLIC __declspec(dllimport) # endif # define GSI_LOCAL +# define GSI_PUBLIC_TEMPLATE # else # if __GNUC__ >= 4 || defined(__clang__) # define GSI_PUBLIC __attribute__ ((visibility ("default"))) +# define GSI_PUBLIC_TEMPLATE __attribute__ ((visibility ("default"))) # define GSI_LOCAL __attribute__ ((visibility ("hidden"))) # else # define GSI_PUBLIC +# define GSI_PUBLIC_TEMPLATE # define GSI_LOCAL # endif diff --git a/src/tl/tl/tlEvents.h b/src/tl/tl/tlEvents.h index 08af5a123..0d644e101 100644 --- a/src/tl/tl/tlEvents.h +++ b/src/tl/tl/tlEvents.h @@ -114,12 +114,12 @@ void handle_event_exception (std::exception &ex); * @endcode */ -template class TL_PUBLIC event_function_base; -template class TL_PUBLIC event_function; -template class TL_PUBLIC event_function_with_data; -template class TL_PUBLIC generic_event_function; -template class TL_PUBLIC generic_event_function_with_data; -template class TL_PUBLIC event; +template class TL_PUBLIC_TEMPLATE event_function_base; +template class TL_PUBLIC_TEMPLATE event_function; +template class TL_PUBLIC_TEMPLATE event_function_with_data; +template class TL_PUBLIC_TEMPLATE generic_event_function; +template class TL_PUBLIC_TEMPLATE generic_event_function_with_data; +template class TL_PUBLIC_TEMPLATE event; typedef event<> Event; #define _COUNT 0 diff --git a/src/tl/tl/tlEventsVar.h b/src/tl/tl/tlEventsVar.h index cca4c78e3..93db20bf2 100644 --- a/src/tl/tl/tlEventsVar.h +++ b/src/tl/tl/tlEventsVar.h @@ -31,7 +31,7 @@ #endif template <_TMPLARGS> -class TL_PUBLIC event_function_base<_TMPLARGLISTP> +class TL_PUBLIC_TEMPLATE event_function_base<_TMPLARGLISTP> : public tl::Object { public: @@ -42,7 +42,7 @@ public: }; template <_JOIN(class T, _TMPLARGS)> -class TL_PUBLIC event_function +class TL_PUBLIC_TEMPLATE event_function : public event_function_base<_TMPLARGLIST> { public: @@ -71,7 +71,7 @@ private: }; template -class TL_PUBLIC event_function_with_data +class TL_PUBLIC_TEMPLATE event_function_with_data : public event_function_base<_TMPLARGLIST> { public: @@ -101,7 +101,7 @@ private: }; template <_JOIN(class T, _TMPLARGS)> -class TL_PUBLIC generic_event_function +class TL_PUBLIC_TEMPLATE generic_event_function : public event_function_base<_TMPLARGLIST> { public: @@ -131,7 +131,7 @@ private: }; template -class TL_PUBLIC generic_event_function_with_data +class TL_PUBLIC_TEMPLATE generic_event_function_with_data : public event_function_base<_TMPLARGLIST> { public: @@ -162,7 +162,7 @@ private: }; template <_TMPLARGS> -class TL_PUBLIC event<_TMPLARGLISTP> +class TL_PUBLIC_TEMPLATE event<_TMPLARGLISTP> { public: typedef event_function_base<_TMPLARGLISTP> func; diff --git a/src/tl/tl/tlObject.h b/src/tl/tl/tlObject.h index e786d19a5..b170744e0 100644 --- a/src/tl/tl/tlObject.h +++ b/src/tl/tl/tlObject.h @@ -240,7 +240,7 @@ private: * This class represents a weak or shared pointer for the given type T. */ template -class TL_PUBLIC weak_or_shared_ptr +class TL_PUBLIC_TEMPLATE weak_or_shared_ptr : public WeakOrSharedPtr { public: @@ -376,7 +376,7 @@ public: * See description of tl::Object for details. */ template -class TL_PUBLIC weak_ptr +class TL_PUBLIC_TEMPLATE weak_ptr : public weak_or_shared_ptr { public: @@ -404,7 +404,7 @@ public: * See description of tl::Object for details. */ template -class TL_PUBLIC shared_ptr +class TL_PUBLIC_TEMPLATE shared_ptr : public weak_or_shared_ptr { public: diff --git a/src/tl/tl/tlVariant.h b/src/tl/tl/tlVariant.h index 3e1f6074c..6dfbdae51 100644 --- a/src/tl/tl/tlVariant.h +++ b/src/tl/tl/tlVariant.h @@ -44,7 +44,7 @@ namespace gsi { class GSI_PUBLIC ClassBase; struct NoAdaptorTag; - template class GSI_PUBLIC Class; + template class GSI_PUBLIC_TEMPLATE Class; template const ClassBase *cls_decl (); } @@ -102,7 +102,7 @@ protected: * We will employ RTTI to identify a type through that base class. */ template -class TL_PUBLIC VariantUserClass +class TL_PUBLIC_TEMPLATE VariantUserClass : public VariantUserClassBase { public: diff --git a/src/tl/tl/tlXMLParser.h b/src/tl/tl/tlXMLParser.h index 168c7e31e..df3c1cc4a 100644 --- a/src/tl/tl/tlXMLParser.h +++ b/src/tl/tl/tlXMLParser.h @@ -150,7 +150,7 @@ public: */ template -class TL_PUBLIC XMLReaderProxy +class TL_PUBLIC_TEMPLATE XMLReaderProxy : public XMLReaderProxyBase { public: @@ -714,7 +714,7 @@ private: */ template -class TL_PUBLIC XMLElement +class TL_PUBLIC_TEMPLATE XMLElement : public XMLElementBase { public: @@ -819,7 +819,7 @@ private: */ template -class TL_PUBLIC XMLElementWithParentRef +class TL_PUBLIC_TEMPLATE XMLElementWithParentRef : public XMLElementBase { public: @@ -933,7 +933,7 @@ private: */ template -class TL_PUBLIC XMLMember +class TL_PUBLIC_TEMPLATE XMLMember : public XMLElementBase { public: @@ -1024,7 +1024,7 @@ private: */ template -class TL_PUBLIC XMLWildcardMember +class TL_PUBLIC_TEMPLATE XMLWildcardMember : public XMLElementBase { public: @@ -1092,7 +1092,7 @@ private: */ template -class TL_PUBLIC XMLStruct +class TL_PUBLIC_TEMPLATE XMLStruct : public XMLElementBase { public: