aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-01-21 10:55:18 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 12:32:58 +0100
commit24c43a5748b850203dd4711de43b92122e0f6cd5 (patch)
tree0ada08f0de3f9481cda69e606b023d1e47ceed2b
parent1b53fb1b6f00fe6bef787d385dddc48d52b090c6 (diff)
Make compile on DragonFly BSD.
[ChangeLog][Platform Specific Changes][BSD] Fixed compile errors on DragonFly BSD and potentially FreeBSD. Task-number: QTBUG-35867 Change-Id: Iea90b93672c34f8a4b56e9afc4dbfb82cc993548 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/jsruntime/qv4alloca_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp7
-rw-r--r--src/qml/jsruntime/qv4mm.cpp8
3 files changed, 17 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h
index f507d174e1..e51c6dff00 100644
--- a/src/qml/jsruntime/qv4alloca_p.h
+++ b/src/qml/jsruntime/qv4alloca_p.h
@@ -50,7 +50,9 @@
# define alloca _alloca
# endif
#else
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
# include <alloca.h>
#endif
+#endif
#endif
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index ac18e56868..dc5a60b341 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -77,6 +77,9 @@
#if USE(PTHREADS)
# include <pthread.h>
# include <sys/resource.h>
+#if HAVE(PTHREAD_NP_H)
+# include <pthread_np.h>
+#endif
#endif
QT_BEGIN_NAMESPACE
@@ -109,7 +112,11 @@ quintptr getStackLimit()
# else
void* stackBottom = 0;
pthread_attr_t attr;
+#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
+ if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
+#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
+#endif
size_t stackSize = 0;
pthread_attr_getstack(&attr, &stackBottom, &stackSize);
pthread_attr_destroy(&attr);
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index 9923c8834c..1d6347b335 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -67,6 +67,10 @@
#include <sys/storage.h> // __tls()
#endif
+#if USE(PTHREADS) && HAVE(PTHREAD_NP_H)
+#include <pthread_np.h>
+#endif
+
QT_BEGIN_NAMESPACE
using namespace QV4;
@@ -234,7 +238,11 @@ MemoryManager::MemoryManager()
# else
void* stackBottom = 0;
pthread_attr_t attr;
+#if HAVE(PTHREAD_NP_H) && OS(FREEBSD)
+ if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
+#else
if (pthread_getattr_np(pthread_self(), &attr) == 0) {
+#endif
size_t stackSize = 0;
pthread_attr_getstack(&attr, &stackBottom, &stackSize);
pthread_attr_destroy(&attr);