aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-09-01 18:29:43 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-09-02 21:25:02 +0000
commit1ea17d70dcdbece5868a2d35417e0bfc66d68739 (patch)
tree757100ad99e951a38c57338ea2f575c3644ba44b /src
parentd1b20513798ed441afddb87fd4e7facce78349e1 (diff)
Fix compilation with ICC on Windows
QV4::Managed is not copyable and its default constructor is deleted. However, it and classes derived from it are exported, which on Windows means the compiler will instantiate all possible functions and add to the DLL. ICC on Windows, unlike MSVC, attempts to instantiate the default constructor of the derived classes (like CallContext) and then the build fails due to the deleted Managed() constructor. Instead, use V4_MANAGED to mark each and every managed class as non- default-constructible and non-copyable. Only one note: the V4_MANAGED macro in QV4::Managed itself takes different parameters, so it needs to be slightly different. Task-number: QTBUG-48063 Change-Id: I42e7ef1a481840699a8dffff140007c65a7a35db Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4managed_p.h10
-rw-r--r--src/qml/jsruntime/qv4object_p.h3
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp4
3 files changed, 11 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 0fe5c7ee49..aa3e668eef 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -60,7 +60,7 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
#define V4_NEEDS_DESTROY static void destroy(QV4::Heap::Base *b) { static_cast<Data *>(b)->~Data(); }
-#define V4_MANAGED(DataClass, superClass) \
+#define V4_MANAGED_ITSELF(DataClass, superClass) \
public: \
Q_MANAGED_CHECK \
typedef QV4::Heap::DataClass Data; \
@@ -70,6 +70,12 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
V4_MANAGED_SIZE_TEST \
QV4::Heap::DataClass *d() const { return static_cast<QV4::Heap::DataClass *>(m); }
+#define V4_MANAGED(DataClass, superClass) \
+ private: \
+ DataClass() Q_DECL_EQ_DELETE; \
+ Q_DISABLE_COPY(DataClass) \
+ V4_MANAGED_ITSELF(DataClass, superClass)
+
#define Q_MANAGED_TYPE(type) \
public: \
enum { MyType = Type_##type };
@@ -125,7 +131,7 @@ const QV4::ManagedVTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(clas
struct Q_QML_PRIVATE_EXPORT Managed : Value
{
- V4_MANAGED(Base, Managed)
+ V4_MANAGED_ITSELF(Base, Managed)
enum {
IsExecutionContext = false,
IsString = false,
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 71a997e133..e2250b9f18 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -72,6 +72,9 @@ struct Object : Base {
Data *d() const { return static_cast<Data *>(m); }
#define V4_OBJECT2(DataClass, superClass) \
+ private: \
+ DataClass() Q_DECL_EQ_DELETE; \
+ Q_DISABLE_COPY(DataClass) \
public: \
Q_MANAGED_CHECK \
typedef QV4::Heap::DataClass Data; \
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 2a3ede6a22..5586bdbb50 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -324,10 +324,6 @@ struct Node : public Object
static ReturnedValue create(ExecutionEngine *v4, NodeImpl *);
bool isNull() const;
-
-private:
- Node &operator=(const Node &);
- Node(const Node &o);
};
Heap::Node::Node(ExecutionEngine *engine, NodeImpl *data)