Merge pull request #14 from klayoutmatthias/macos-build

Some changes for Windows build compatibility
This commit is contained in:
Kazunari Sekigawa 2018-01-02 08:30:08 +09:00 committed by GitHub
commit 3bc7756aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 190 additions and 126 deletions

View File

@ -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

View File

@ -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

View File

@ -57,7 +57,7 @@ class ArrayRepository;
*/
template <class C, class R = C>
struct DB_PUBLIC box
struct DB_PUBLIC_TEMPLATE box
{
typedef C coord_type;
typedef box<C, R> box_type;

View File

@ -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

View File

@ -42,7 +42,7 @@ template <class C> class generic_repository;
class ArrayRepository;
template <class C>
class DB_PUBLIC edge
class DB_PUBLIC_TEMPLATE edge
{
public:
typedef C coord_type;

View File

@ -40,7 +40,7 @@
namespace db {
template <class C>
class DB_PUBLIC edge_pair
class DB_PUBLIC_TEMPLATE edge_pair
{
public:
typedef C coord_type;

View File

@ -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 IterTraits>
class DB_PUBLIC instance_iterator
{

View File

@ -69,7 +69,7 @@ typedef generic_repository<db::Coord> GenericRepository;
* Since we are using a custom cell list, we have to provide our own iterator
*/
template <class C>
class DB_PUBLIC cell_list_iterator
class DB_PUBLIC_TEMPLATE cell_list_iterator
{
public:
typedef C cell_type;

View File

@ -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 C>
class DB_PUBLIC path
{

View File

@ -43,7 +43,7 @@ template <class C> class vector;
*/
template <class C>
class DB_PUBLIC point
class DB_PUBLIC_TEMPLATE point
{
public:
typedef C coord_type;

View File

@ -83,6 +83,8 @@ inline bool default_compression<db::DCoord> ()
* 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 C>
class DB_PUBLIC polygon_contour
{
@ -1364,7 +1366,7 @@ private:
*/
template <class C>
class DB_PUBLIC polygon
class DB_PUBLIC_TEMPLATE polygon
{
public:
typedef C coord_type;
@ -2324,7 +2326,7 @@ private:
*/
template <class C>
class DB_PUBLIC simple_polygon
class DB_PUBLIC_TEMPLATE simple_polygon
{
public:
typedef C coord_type;

View File

@ -1593,7 +1593,7 @@ public:
* into the db::Object manager's undo/redo queue.
*/
template <class Sh, class StableTag>
class DB_PUBLIC layer_op
class DB_PUBLIC_TEMPLATE layer_op
: public LayerOpBase
{
public:

View File

@ -222,7 +222,7 @@ private:
*/
template <class C>
class DB_PUBLIC text
class DB_PUBLIC_TEMPLATE text
{
public:
typedef C coord_type;

View File

@ -42,10 +42,10 @@ namespace tl {
namespace db {
template <class I, class F, class R = double> class DB_PUBLIC complex_trans;
template <class C> class DB_PUBLIC simple_trans;
template <class C> class disp_trans;
template <class C> class fixpoint_trans;
template <class I, class F, class R = double> class DB_PUBLIC_TEMPLATE complex_trans;
template <class C> class DB_PUBLIC_TEMPLATE simple_trans;
template <class C> class DB_PUBLIC_TEMPLATE disp_trans;
template <class C> 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<C> &t)
*/
template <class C>
class DB_PUBLIC simple_trans
class DB_PUBLIC_TEMPLATE simple_trans
: public fixpoint_trans<C>
{
public:
@ -1439,7 +1439,7 @@ operator<< (std::ostream &os, const simple_trans<C> &t)
* type used internally for representing the floating-point members).
*/
template <class I, class F, class R>
class DB_PUBLIC complex_trans
class DB_PUBLIC_TEMPLATE complex_trans
{
public:
typedef I coord_type;

View File

@ -45,7 +45,7 @@ template <class C> class point;
*/
template <class C>
class DB_PUBLIC vector
class DB_PUBLIC_TEMPLATE vector
{
public:
typedef C coord_type;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 T>
class GSI_PUBLIC VariantUserClass
class GSI_PUBLIC_TEMPLATE VariantUserClass
: public tl::VariantUserClass<T>, private VariantUserClassImpl
{
public:
@ -551,7 +551,7 @@ public:
* the given methods.
*/
template <class X>
class GSI_PUBLIC ClassExt
class GSI_PUBLIC_TEMPLATE ClassExt
: public ClassBase
{
public:
@ -708,7 +708,7 @@ struct adaptor_type_info<X, NoAdaptorTag>
* or to call it's methods in some generic way.
*/
template <class X, class Adapted = NoAdaptorTag>
class GSI_PUBLIC Class
class GSI_PUBLIC_TEMPLATE Class
: public ClassBase
{
public:
@ -937,7 +937,7 @@ public:
* a subclass of the parent.
*/
template <class P, class X, class Adapted = NoAdaptorTag>
class GSI_PUBLIC ChildClass
class GSI_PUBLIC_TEMPLATE ChildClass
: public Class<X, Adapted>
{
public:
@ -970,7 +970,7 @@ public:
* a subclass of the parent.
*/
template <class P, class X, class B, class Adapted = NoAdaptorTag>
class GSI_PUBLIC ChildSubClass
class GSI_PUBLIC_TEMPLATE ChildSubClass
: public SubClass<X, B, Adapted>
{
public:

View File

@ -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

View File

@ -36,7 +36,7 @@ namespace gsi
class GSI_PUBLIC ClassBase;
struct NoAdaptorTag;
template <class T, class A> class GSI_PUBLIC Class;
template <class T, class A> class GSI_PUBLIC_TEMPLATE Class;
/**
* @brief The implementation delegate for the VariantUserClass<T>

View File

@ -650,7 +650,7 @@ public:
* @brief Generic string adaptor implementation
*/
template <class X>
class GSI_PUBLIC StringAdaptorImpl
class GSI_PUBLIC_TEMPLATE StringAdaptorImpl
: public StringAdaptor
{
};
@ -945,7 +945,7 @@ private:
* @brief Specialization for const unsigned char *
*/
template <class CP>
class GSI_PUBLIC StringAdaptorImplCCP
class GSI_PUBLIC_TEMPLATE StringAdaptorImplCCP
: public StringAdaptor
{
public:
@ -1103,7 +1103,7 @@ public:
* @brief Generic string adaptor implementation
*/
template <class X>
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 Cont>
class GSI_PUBLIC VectorAdaptorIteratorImpl
class GSI_PUBLIC_TEMPLATE VectorAdaptorIteratorImpl
: public VectorAdaptorIterator
{
public:
@ -1434,7 +1434,7 @@ void push_vector (QSet<X> &v, const X &x)
* @brief Implementation of the generic adaptor for a specific container
*/
template <class Cont>
class GSI_PUBLIC VectorAdaptorImpl
class GSI_PUBLIC_TEMPLATE VectorAdaptorImpl
: public VectorAdaptor
{
public:
@ -1709,7 +1709,7 @@ struct map_access<QHash<X, Y> >
* @brief Implementation of the generic iterator adaptor for a specific container
*/
template <class Cont>
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 Cont>
class GSI_PUBLIC MapAdaptorImpl
class GSI_PUBLIC_TEMPLATE MapAdaptorImpl
: public MapAdaptor
{
public:

View File

@ -62,12 +62,12 @@ class GSI_PUBLIC StringAdaptor;
class GSI_PUBLIC VariantAdaptor;
class GSI_PUBLIC ClassBase;
struct NoAdaptorTag;
template <class X, class A> class GSI_PUBLIC Class;
template <class X, class A> class GSI_PUBLIC_TEMPLATE Class;
template <class X> struct ClassTag;
template <class I> class GSI_PUBLIC IterAdaptor;
template <class V> class GSI_PUBLIC IterPtrAdaptor;
template <class V> class GSI_PUBLIC ConstIterPtrAdaptor;
template <class I> class GSI_PUBLIC FreeIterAdaptor;
template <class I> class GSI_PUBLIC_TEMPLATE IterAdaptor;
template <class V> class GSI_PUBLIC_TEMPLATE IterPtrAdaptor;
template <class V> class GSI_PUBLIC_TEMPLATE ConstIterPtrAdaptor;
template <class I> class GSI_PUBLIC_TEMPLATE FreeIterAdaptor;
template <class X> const ClassBase *cls_decl ();
/**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -114,12 +114,12 @@ void handle_event_exception (std::exception &ex);
* @endcode
*/
template <class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC event_function_base;
template <class T, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC event_function;
template <class T, class D, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC event_function_with_data;
template <class T, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC generic_event_function;
template <class T, class D, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC generic_event_function_with_data;
template <class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC event;
template <class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE event_function_base;
template <class T, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE event_function;
template <class T, class D, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE event_function_with_data;
template <class T, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE generic_event_function;
template <class T, class D, class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE generic_event_function_with_data;
template <class A1 = void, class A2 = void, class A3 = void, class A4 = void, class A5 = void> class TL_PUBLIC_TEMPLATE event;
typedef event<> Event;
#define _COUNT 0

View File

@ -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<T, _TMPLARGLISTP>
class TL_PUBLIC_TEMPLATE event_function<T, _TMPLARGLISTP>
: public event_function_base<_TMPLARGLIST>
{
public:
@ -71,7 +71,7 @@ private:
};
template <class T, _JOIN(class D, _TMPLARGS)>
class TL_PUBLIC event_function_with_data<T, D, _TMPLARGLISTP>
class TL_PUBLIC_TEMPLATE event_function_with_data<T, D, _TMPLARGLISTP>
: public event_function_base<_TMPLARGLIST>
{
public:
@ -101,7 +101,7 @@ private:
};
template <_JOIN(class T, _TMPLARGS)>
class TL_PUBLIC generic_event_function<T, _TMPLARGLISTP>
class TL_PUBLIC_TEMPLATE generic_event_function<T, _TMPLARGLISTP>
: public event_function_base<_TMPLARGLIST>
{
public:
@ -131,7 +131,7 @@ private:
};
template <class T, _JOIN(class D, _TMPLARGS)>
class TL_PUBLIC generic_event_function_with_data<T, D, _TMPLARGLISTP>
class TL_PUBLIC_TEMPLATE generic_event_function_with_data<T, D, _TMPLARGLISTP>
: 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;

View File

@ -240,7 +240,7 @@ private:
* This class represents a weak or shared pointer for the given type T.
*/
template <class T, bool Shared>
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 T>
class TL_PUBLIC weak_ptr
class TL_PUBLIC_TEMPLATE weak_ptr
: public weak_or_shared_ptr<T, false>
{
public:
@ -404,7 +404,7 @@ public:
* See description of tl::Object for details.
*/
template <class T>
class TL_PUBLIC shared_ptr
class TL_PUBLIC_TEMPLATE shared_ptr
: public weak_or_shared_ptr<T, true>
{
public:

View File

@ -44,7 +44,7 @@ namespace gsi
{
class GSI_PUBLIC ClassBase;
struct NoAdaptorTag;
template <class T, class A> class GSI_PUBLIC Class;
template <class T, class A> class GSI_PUBLIC_TEMPLATE Class;
template <class X> const ClassBase *cls_decl ();
}
@ -102,7 +102,7 @@ protected:
* We will employ RTTI to identify a type through that base class.
*/
template <class T>
class TL_PUBLIC VariantUserClass
class TL_PUBLIC_TEMPLATE VariantUserClass
: public VariantUserClassBase
{
public:

View File

@ -150,7 +150,7 @@ public:
*/
template <class Obj>
class TL_PUBLIC XMLReaderProxy
class TL_PUBLIC_TEMPLATE XMLReaderProxy
: public XMLReaderProxyBase
{
public:
@ -714,7 +714,7 @@ private:
*/
template <class Obj, class Parent, class Read, class Write>
class TL_PUBLIC XMLElement
class TL_PUBLIC_TEMPLATE XMLElement
: public XMLElementBase
{
public:
@ -819,7 +819,7 @@ private:
*/
template <class Obj, class Parent, class Read, class Write>
class TL_PUBLIC XMLElementWithParentRef
class TL_PUBLIC_TEMPLATE XMLElementWithParentRef
: public XMLElementBase
{
public:
@ -933,7 +933,7 @@ private:
*/
template <class Value, class Parent, class Read, class Write, class Converter>
class TL_PUBLIC XMLMember
class TL_PUBLIC_TEMPLATE XMLMember
: public XMLElementBase
{
public:
@ -1024,7 +1024,7 @@ private:
*/
template <class Value, class Parent, class Write, class Converter>
class TL_PUBLIC XMLWildcardMember
class TL_PUBLIC_TEMPLATE XMLWildcardMember
: public XMLElementBase
{
public:
@ -1092,7 +1092,7 @@ private:
*/
template <class Obj>
class TL_PUBLIC XMLStruct
class TL_PUBLIC_TEMPLATE XMLStruct
: public XMLElementBase
{
public:

View File

@ -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)

View File

@ -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

View File

@ -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" )

View File

@ -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