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: diff --git a/testdata/python/basic.py b/testdata/python/basic.py index 38595d8e8..ea4f63eb5 100644 --- a/testdata/python/basic.py +++ b/testdata/python/basic.py @@ -92,6 +92,28 @@ def ph(x): else: return x.replace("X", "") +def map2str(dict): + # A helper function to product a "canonical" (i.e. sorted-keys) string + # representation of a dict + keys = list(dict) + + for k in keys: + if type(k) is str: + strKeys = [] + strDict = {} + for x in keys: + strKeys.append(str(x)) + strDict[str(x)] = dict[x] + strings = [] + for x in sorted(strKeys): + strings.append(str(x) + ": " + str(strDict[x])) + return "{" + ", ".join(strings) + "}" + + strings = [] + for x in sorted(keys): + strings.append(str(x) + ": " + str(dict[x])) + return "{" + ", ".join(strings) + "}" + class BasicTest(unittest.TestCase): def test_00(self): @@ -2066,44 +2088,27 @@ class BasicTest(unittest.TestCase): def test_41(self): - v3 = sys.version_info >= (3, 0) - # maps b = pya.B() b.insert_map1(1, "hello") - if v3: - self.assertEqual(repr(b.map1), "{1: 'hello'}") - else: - self.assertEqual(repr(b.map1), "{1L: 'hello'}") + self.assertEqual(map2str(b.map1), "{1: hello}") b.map1 = {} b.insert_map1(2, "hello") - if v3: - self.assertEqual(repr(b.map1_cref()), "{2: 'hello'}") - else: - self.assertEqual(repr(b.map1_cref()), "{2L: 'hello'}") + self.assertEqual(map2str(b.map1_cref()), "{2: hello}") b.map1 = {} b.insert_map1(3, "hello") - if v3: - self.assertEqual(repr(b.map1_cptr()), "{3: 'hello'}") - else: - self.assertEqual(repr(b.map1_cptr()), "{3L: 'hello'}") + self.assertEqual(map2str(b.map1_cptr()), "{3: hello}") b.map1 = {} b.insert_map1(4, "hello") - if v3: - self.assertEqual(repr(b.map1_ref()), "{4: 'hello'}") - else: - self.assertEqual(repr(b.map1_ref()), "{4L: 'hello'}") + self.assertEqual(map2str(b.map1_ref()), "{4: hello}") b.map1 = {} b.insert_map1(5, "hello") - if v3: - self.assertEqual(repr(b.map1_ptr()), "{5: 'hello'}") - else: - self.assertEqual(repr(b.map1_ptr()), "{5L: 'hello'}") + self.assertEqual(map2str(b.map1_ptr()), "{5: hello}") self.assertEqual(b.map1_cptr_null() == None, True); self.assertEqual(b.map1_ptr_null() == None, True); @@ -2117,52 +2122,28 @@ class BasicTest(unittest.TestCase): self.assertEqual(error_caught, True) b.map1 = { 42: "1", -17: "True" } - if v3: - self.assertEqual(repr(b.map1), "{42: '1', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '1', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 1}") b.set_map1_cref({ 42: "2", -17: "True" }) - if v3: - self.assertEqual(repr(b.map1), "{42: '2', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '2', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 2}") b.set_map1_cptr({ 42: "3", -17: "True" }) - if v3: - self.assertEqual(repr(b.map1), "{42: '3', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '3', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 3}") b.set_map1_cptr(None) - if v3: - self.assertEqual(repr(b.map1), "{42: '3', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '3', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 3}") b.set_map1_ref({ 42: "4", -17: "True" }) - if v3: - self.assertEqual(repr(b.map1), "{42: '4', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '4', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 4}") b.set_map1_ptr({ 42: "5", -17: "True" }) - if v3: - self.assertEqual(repr(b.map1), "{42: '5', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '5', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 5}") b.set_map1_ptr(None) - if v3: - self.assertEqual(repr(b.map1), "{42: '5', -17: 'True'}") - else: - self.assertEqual(repr(b.map1), "{42L: '5', -17L: 'True'}") + self.assertEqual(map2str(b.map1), "{-17: True, 42: 5}") b.map2 = { 'xy': 1, -17: True } - if v3: - self.assertEqual(repr(b.map2), "{'xy': 1, -17: True}") - else: - self.assertEqual(repr(b.map2), "{'xy': 1L, -17L: True}") + self.assertEqual(map2str(b.map2), "{-17: True, xy: 1}") self.assertEqual(b.map2_null(), None) diff --git a/testdata/python/qtbinding.py b/testdata/python/qtbinding.py index 494c363d4..f1f79f60b 100644 --- a/testdata/python/qtbinding.py +++ b/testdata/python/qtbinding.py @@ -77,6 +77,28 @@ class MyObject(pya.QObject): def on_event_filter(self, ef): self.ef = ef +def map2str(dict): + # A helper function to product a "canonical" (i.e. sorted-keys) string + # representation of a dict + keys = list(dict) + + for k in keys: + if type(k) is str: + strKeys = [] + strDict = {} + for x in keys: + strKeys.append(str(x)) + strDict[str(x)] = dict[x] + strings = [] + for x in sorted(strKeys): + strings.append(str(x) + ": " + str(strDict[x])) + return "{" + ", ".join(strings) + "}" + + strings = [] + for x in sorted(keys): + strings.append(str(x) + ": " + str(dict[x])) + return "{" + ", ".join(strings) + "}" + # The Qt binding tests class QtBindingTest(unittest.TestCase): @@ -462,15 +484,13 @@ class QtBindingTest(unittest.TestCase): # QHash bindings slm = MyStandardItemModel() - r1 = "{0: \'display\', 1: \'decoration\', 2: \'edit\', 3: \'toolTip\', 4: \'statusTip\', 5: \'whatsThis\'}" - r2 = "{0L: \'display\', 1L: \'decoration\', 2L: \'edit\', 3L: \'toolTip\', 4L: \'statusTip\', 5L: \'whatsThis\'}" - self.assertEqual(str(slm.roleNames()) == r1 or str(slm.roleNames()) == r2, True) rn = slm.roleNames() - rn[7] = "blabla" - slm.srn(rn) - r1 = "{0: \'display\', 1: \'decoration\', 2: \'edit\', 3: \'toolTip\', 4: \'statusTip\', 5: \'whatsThis\', 7: \'blabla\'}" - r2 = "{0L: \'display\', 1L: \'decoration\', 2L: \'edit\', 3L: \'toolTip\', 4L: \'statusTip\', 5L: \'whatsThis\', 7L: \'blabla\'}" - self.assertEqual(str(slm.roleNames()) == r1 or str(slm.roleNames()) == r2, True) + self.assertEqual(map2str(rn), "{0: display, 1: decoration, 2: edit, 3: toolTip, 4: statusTip, 5: whatsThis}") + rnNew = slm.roleNames() + rnNew[7] = "blabla" + slm.srn(rnNew) + rn = slm.roleNames() + self.assertEqual(map2str(rn), "{0: display, 1: decoration, 2: edit, 3: toolTip, 4: statusTip, 5: whatsThis, 7: blabla}") def test_44(self): @@ -488,8 +508,8 @@ class QtBindingTest(unittest.TestCase): self.assertEqual(child.height > 100, True) parent.resize(100, 100) - self.assertEqual(child.width < 100, True) - self.assertEqual(child.height < 100, True) + self.assertEqual(child.width <= 100, True) + self.assertEqual(child.height <= 100, True) # now if we delete the parent, the child needs to become disconnected diff --git a/testdata/ruby/dbTransTest.rb b/testdata/ruby/dbTransTest.rb index c94204de8..94e9d93f7 100644 --- a/testdata/ruby/dbTransTest.rb +++ b/testdata/ruby/dbTransTest.rb @@ -170,7 +170,7 @@ class DBTrans_TestClass < TestBase assert_equal( c.is_mag?, true ) assert_equal( c.rot, RBA::DCplxTrans::M0.rot ) assert_equal( c.s_trans.to_s, "m0 2.5,-12.5" ) - assert_equal( c.angle, 45 ) + assert_equal( (c.angle - 45).abs < 1e-10, true ) assert_equal( c.ctrans( 5 ).to_s, "3.75" ) assert_equal( c.trans( RBA::DPoint::new( 12, 16 ) ).to_s, "17.3492424049,-14.6213203436" ) @@ -324,7 +324,7 @@ class DBTrans_TestClass < TestBase assert_equal( c.is_mag?, true ) assert_equal( c.rot, RBA::CplxTrans::M0.rot ) assert_equal( c.s_trans.to_s, "m0 3,-13" ) - assert_equal( c.angle, 45 ) + assert_equal( (c.angle - 45).abs < 1e-10, true ) assert_equal( c.ctrans( 5 ).to_s, "3.75" ) assert_equal( c.trans( RBA::Point::new( 12, 16 ) ).to_s, "17.3492424049,-14.6213203436" ) diff --git a/testdata/ruby/qtbinding.rb b/testdata/ruby/qtbinding.rb index c74c396ad..cce2909bb 100644 --- a/testdata/ruby/qtbinding.rb +++ b/testdata/ruby/qtbinding.rb @@ -576,8 +576,8 @@ class QtBinding_TestClass < TestBase assert_equal(child.height() > 100, true) parent.resize(100, 100) - assert_equal(child.width() < 100, true) - assert_equal(child.height() < 100, true) + assert_equal(child.width() <= 100, true) + assert_equal(child.height() <= 100, true) # now if we delete the parent, the child needs to become disconnected