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>
This commit is contained in:
Alex Blasche 2014-01-21 10:55:18 +01:00 committed by The Qt Project
parent 1b53fb1b6f
commit 24c43a5748
3 changed files with 17 additions and 0 deletions

View File

@ -50,7 +50,9 @@
# define alloca _alloca
# endif
#else
#if !defined(__FreeBSD__) && !defined(__DragonFly__)
# include <alloca.h>
#endif
#endif
#endif

View 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);

View File

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