diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-07-21 16:15:11 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-07-29 08:55:02 (GMT) |
commit | 2ce3e9c150798b12d5b434ed25fc37c96972fb8b (patch) | |
tree | 64157ddd4daf2f7b70901afca52df6f02fe3cc72 /src/3rdparty/webkit | |
parent | d7b688870aead912690188b324d370b920a7a600 (diff) | |
download | Qt-2ce3e9c150798b12d5b434ed25fc37c96972fb8b.zip Qt-2ce3e9c150798b12d5b434ed25fc37c96972fb8b.tar.gz Qt-2ce3e9c150798b12d5b434ed25fc37c96972fb8b.tar.bz2 |
Port of Qt to QNX
This makes Qt work on QNX 6.4.
* no q3support, no phonon
* no QSharedMemory, no QSystemSemaphore, no QProcess
Reviewed-By: Robert Griebl
Diffstat (limited to 'src/3rdparty/webkit')
4 files changed, 53 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp index 30ffb5b..bc5582c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp @@ -89,6 +89,13 @@ extern int *__libc_stack_end; #include <pthread_np.h> #endif +#if PLATFORM(QNX) +#include <fcntl.h> +#include <sys/procfs.h> +#include <stdio.h> +#include <errno.h> +#endif + #endif #define DEBUG_COLLECTOR 0 @@ -580,6 +587,24 @@ static inline void* currentThreadStackBase() static pthread_t stackThread; pthread_t thread = pthread_self(); if (stackBase == 0 || thread != stackThread) { +#if PLATFORM(QNX) + int fd; + struct _debug_thread_info tinfo; + memset(&tinfo, 0, sizeof(tinfo)); + tinfo.tid = pthread_self(); + fd = open("/proc/self", O_RDONLY); + if (fd == -1) { +#ifndef NDEBUG + perror("Unable to open /proc/self:"); +#endif + return 0; + } + devctl(fd, DCMD_PROC_TIDSTATUS, &tinfo, sizeof(tinfo), NULL); + close(fd); + stackBase = (void*)tinfo.stkbase; + stackSize = tinfo.stksize; + ASSERT(stackBase); +#else #if defined(QT_LINUXBASE) // LinuxBase is missing pthread_getattr_np - resolve it once at runtime instead // see http://bugs.linuxbase.org/show_bug.cgi?id=2364 @@ -604,6 +629,7 @@ static inline void* currentThreadStackBase() (void)rc; // FIXME: Deal with error code somehow? Seems fatal. ASSERT(stackBase); pthread_attr_destroy(&sattr); +#endif stackThread = thread; } return static_cast<char*>(stackBase) + stackSize; diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp index 648dc70..0b76649 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/DateMath.cpp @@ -841,7 +841,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString) return NaN; int sgn = (o < 0) ? -1 : 1; - o = abs(o); + o = labs(o); if (*dateString != ':') { offset = ((o / 100) * 60 + (o % 100)) * sgn; } else { // GMT+05:00 diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index 5b43d17..aabe84d 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -109,6 +109,13 @@ #define WTF_PLATFORM_NETBSD 1 #endif +/* PLATFORM(QNX) */ +/* Operating system level dependencies for QNX that should be used */ +/* regardless of operating environment */ +#if defined(__QNXNTO__) +#define WTF_PLATFORM_QNX 1 +#endif + /* PLATFORM(UNIX) */ /* Operating system level dependencies for Unix-like systems that */ /* should be used regardless of operating environment */ @@ -119,7 +126,8 @@ || defined(unix) \ || defined(__unix) \ || defined(__unix__) \ - || defined(_AIX) + || defined(_AIX) \ + || defined(__QNXNTO__) #define WTF_PLATFORM_UNIX 1 #endif @@ -481,6 +489,15 @@ #define HAVE_SYS_PARAM_H 1 #endif +#elif PLATFORM(QNX) + +#define HAVE_ERRNO_H 1 +#define HAVE_MMAP 1 +#define HAVE_SBRK 1 +#define HAVE_STRINGS_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_TIME_H 1 + #else /* FIXME: is this actually used or do other platforms generate their own config.h? */ diff --git a/src/3rdparty/webkit/WebCore/bridge/npapi.h b/src/3rdparty/webkit/WebCore/bridge/npapi.h index 003e67a..07fed86 100644 --- a/src/3rdparty/webkit/WebCore/bridge/npapi.h +++ b/src/3rdparty/webkit/WebCore/bridge/npapi.h @@ -114,6 +114,14 @@ /* Definition of Basic Types */ /*----------------------------------------------------------------------*/ +/* QNX sets the _INT16 and friends defines, but does not typedef the types */ +#ifdef __QNXNTO__ +#undef _UINT16 +#undef _INT16 +#undef _UINT32 +#undef _INT32 +#endif + #ifndef _UINT16 #define _UINT16 typedef unsigned short uint16; |