Make compile on DragonFly BSD.
authorAlex Blasche <alexander.blasche@digia.com>
Tue, 21 Jan 2014 09:55:18 +0000 (10:55 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 21 Jan 2014 11:32:58 +0000 (12:32 +0100)
[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>
src/qml/jsruntime/qv4alloca_p.h
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4mm.cpp

index f507d174e1ffa0a24ee326435d2c10f6dc563397..e51c6dff004496f21d828879bd62139d5f7c8184 100644 (file)
@@ -50,7 +50,9 @@
 #    define alloca _alloca
 #  endif
 #else
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
 #  include <alloca.h>
 #endif
+#endif
 
 #endif
index ac18e568685389b4ad10321d6ed410d7ef633dc8..dc5a60b341f666f2c5adb319c26b9c9a03e79aaf 100644 (file)
@@ -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);
index 9923c8834caaaf703233d16e7098b6c86c2f6b4d..1d6347b335b4c53bdf65c3ac6ebc1a863a27e302 100644 (file)
 #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);