summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorTobias Koenig <tobias.koenig@kdab.com>2014-12-16 11:08:37 +0000
committerTobias Koenig <tobias.koenig@kdab.com>2015-01-10 15:26:00 +0100
commitc2b86ade9e1aca5b729676ec8f3fe8fc783690ba (patch)
tree68a7489d7824e4bdd745abfe79bc03a686d8297b /src/corelib
parent82413cd35f34d7bdd0ed5a1dbdcdca4d03747151 (diff)
Haiku: Make corelib compile on Haiku
Change-Id: I66bc492390eedd723ab7866d3c7a38539d708727 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.cpp5
-rw-r--r--src/corelib/global/qsystemdetection.h3
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp3
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp2
-rw-r--r--src/corelib/tools/tools.pri2
5 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e817b05243..4895bf6dd9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2471,6 +2471,9 @@ QString QSysInfo::productType()
#elif defined(Q_OS_DARWIN)
return QStringLiteral("darwin");
+#elif defined(Q_OS_HAIKU)
+ return QStringLiteral("haiku");
+
#elif defined(USE_ETC_OS_RELEASE) // Q_OS_UNIX
QUnixOSVersion unixOsVersion;
readEtcOsRelease(unixOsVersion);
@@ -2601,6 +2604,8 @@ QString QSysInfo::prettyProductName()
return QLatin1String("Android ") + productVersion();
#elif defined(Q_OS_BLACKBERRY)
return QLatin1String("BlackBerry ") + productVersion();
+#elif defined(Q_OS_HAIKU)
+ return QLatin1String("Haiku ") + productVersion();
#elif defined(Q_OS_UNIX)
# ifdef USE_ETC_OS_RELEASE
QUnixOSVersion unixOsVersion;
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 08a5daa5f4..37d571e228 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -75,6 +75,7 @@
BSD4 - Any BSD 4.4 system
UNIX - Any UNIX BSD/SYSV system
ANDROID - Android platform
+ HAIKU - Haiku
The following operating systems have variants:
LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
@@ -169,6 +170,8 @@
# define Q_OS_INTEGRITY
#elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */
# define Q_OS_VXWORKS
+#elif defined(__HAIKU__)
+# define Q_OS_HAIKU
#elif defined(__MAKEDEPEND__)
#else
# error "Qt has not been ported to this OS - see http://www.qt-project.org/"
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 1af2145296..83d94bfe06 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -75,6 +75,9 @@
# if !defined(ST_RDONLY)
# define ST_RDONLY 1 // hack for missing define on Android
# endif
+#elif defined(Q_OS_HAIKU)
+# define QT_STATFSBUF struct statvfs
+# define QT_STATFS ::statvfs
#else
# if defined(QT_LARGEFILE_SUPPORT)
# define QT_STATFSBUF struct statvfs64
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index 3bcf3202a1..979a5f2300 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -70,7 +70,7 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
pthread_condattr_t condattr;
pthread_condattr_init(&condattr);
-#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
#endif
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 01b514d329..a7fbc15bea 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -214,7 +214,7 @@ INCLUDEPATH += ../3rdparty/md5 \
../3rdparty/sha3
# Note: libm should be present by default becaue this is C++
-!macx-icc:!vxworks:unix:LIBS_PRIVATE += -lm
+!macx-icc:!vxworks:!haiku:unix:LIBS_PRIVATE += -lm
TR_EXCLUDE += ../3rdparty/*