aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-04-12 15:51:47 +0200
committerLars Knoll <lars.knoll@digia.com>2013-04-12 17:30:58 +0200
commitcaddc2a7b4f0b6433462d2b4660a2d9ac26585fd (patch)
tree2d0ecd417db42439ee5a40d4c7be478aa8b1d916 /src/3rdparty/masm
parent1cdcfa500ac971727d57db8edcb41abe38516e5a (diff)
Fix build of the rest of v4vm against WTF/JSC update
* Add missing functions to our WTF stubs * Some of the math functions wrapped with MathExtras.h are back in the std:: namespace they belong to Change-Id: I9da43e8344ab8c95edc8db19f44ccdbd91b4ac70 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/masm')
-rw-r--r--src/3rdparty/masm/stubs/wtf/PassOwnPtr.h4
-rw-r--r--src/3rdparty/masm/stubs/wtf/Vector.h11
2 files changed, 14 insertions, 1 deletions
diff --git a/src/3rdparty/masm/stubs/wtf/PassOwnPtr.h b/src/3rdparty/masm/stubs/wtf/PassOwnPtr.h
index f9b84e7b57..601d278c16 100644
--- a/src/3rdparty/masm/stubs/wtf/PassOwnPtr.h
+++ b/src/3rdparty/masm/stubs/wtf/PassOwnPtr.h
@@ -54,6 +54,10 @@ struct OwnPtr : public QScopedPointer<T>
: QScopedPointer<T>(ptr.leakRef())
{}
+ OwnPtr(const OwnPtr<T>& other)
+ : QScopedPointer<T>(const_cast<OwnPtr<T> &>(other).take())
+ {}
+
OwnPtr& operator=(const OwnPtr<T>& other)
{
this->reset(const_cast<OwnPtr<T> &>(other).take());
diff --git a/src/3rdparty/masm/stubs/wtf/Vector.h b/src/3rdparty/masm/stubs/wtf/Vector.h
index 1feea851e1..39742d8ab0 100644
--- a/src/3rdparty/masm/stubs/wtf/Vector.h
+++ b/src/3rdparty/masm/stubs/wtf/Vector.h
@@ -46,9 +46,13 @@
#include <wtf/NotFound.h>
#include <qalgorithms.h>
+enum WTF_UnusedOverflowMode {
+ UnsafeVectorOverflow
+};
+
namespace WTF {
-template <typename T, int capacity = 1>
+template <typename T, int capacity = 1, int overflowMode = UnsafeVectorOverflow>
class Vector : public std::vector<T> {
public:
Vector() {}
@@ -64,6 +68,8 @@ public:
using std::vector<T>::insert;
+ inline void reserveInitialCapacity(size_t size) { this->reserve(size); }
+
inline void insert(size_t position, T value)
{ this->insert(this->begin() + position, value); }
@@ -73,6 +79,9 @@ public:
inline void shrink(size_t size)
{ this->erase(this->begin() + size, this->end()); }
+ inline void shrinkToFit()
+ { this->shrink_to_fit(); }
+
inline void remove(size_t position)
{ this->erase(this->begin() + position); }