summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2010-04-29 14:47:35 +0200
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2010-05-14 09:52:41 +0200
commit075e96eba50013c583234b787562e09bb7535dd8 (patch)
treeb309e9b03b4a4693906a73c946d71bb2fb5fa193 /src/corelib
parentdcb472d839f41b29d3926c67c36e246a4e0049e0 (diff)
Say hello to Qt for Native Client.
This commits adds build system to support for the native client compiler (x86-only for now), sets up global defines, and adds compile fixes for QtCore and QtGui. Details: * Add mkspecs for linux-nacl-g++ and macx-nacl-c++ * Add nacl configure option * Add qconfig-minimal-system-dependencies.h * Define Q_OS_NACL in qglobal.h * Add qnacalunimplemented.h/cpp with POSIX stubs. * .pro file changes for cross-compiling on Mac
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/arch/qatomic_arch.h2
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/global/global.pri4
-rw-r--r--src/corelib/global/qconfig-minimal-system-dependencies.h371
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/global/qnaclunimplemented.cpp156
-rw-r--r--src/corelib/global/qnaclunimplemented.h85
-rw-r--r--src/corelib/io/io.pri10
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/kernel/kernel.pri4
-rw-r--r--src/corelib/kernel/qcore_unix.cpp3
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp14
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h2
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
-rw-r--r--src/corelib/tools/tools.pri2
15 files changed, 651 insertions, 14 deletions
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
index 00b288b17c..5106d290d1 100644
--- a/src/corelib/arch/qatomic_arch.h
+++ b/src/corelib/arch/qatomic_arch.h
@@ -88,6 +88,8 @@ QT_BEGIN_HEADER
# include "QtCore/qatomic_sh.h"
#elif defined(QT_ARCH_SH4A)
# include "QtCore/qatomic_sh4a.h"
+#elif defined(QT_ARCH_NACL)
+# include "QtCore/qatomic_generic.h"
#else
# error "Qt has not been ported to this architecture"
#endif
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 83fa0447e3..5a810b1cbe 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -18,7 +18,7 @@ include(codecs/codecs.pri)
include(statemachine/statemachine.pri)
include(xml/xml.pri)
-mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
+!nacl:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index b916b4d950..758c5ee323 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -13,6 +13,10 @@ SOURCES += \
global/qmalloc.cpp \
global/qnumeric.cpp
+nacl {
+ SOURCES += global/qnaclunimplemented.cpp
+}
+
# qlibraryinfo.cpp includes qconfig.cpp
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
diff --git a/src/corelib/global/qconfig-minimal-system-dependencies.h b/src/corelib/global/qconfig-minimal-system-dependencies.h
new file mode 100644
index 0000000000..c7e3633f80
--- /dev/null
+++ b/src/corelib/global/qconfig-minimal-system-dependencies.h
@@ -0,0 +1,371 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ ** All rights reserved.
+ ** Contact: Nokia Corporation (qt-info@nokia.com)
+ **
+ ** This file is part of the QtCore module of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:LGPL$
+ ** No Commercial Usage
+ ** This file contains pre-release code and may not be distributed.
+ ** You may use this file in accordance with the terms and conditions
+ ** contained in the Technology Preview License Agreement accompanying
+ ** this package.
+ **
+ ** GNU Lesser General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU Lesser
+ ** General Public License version 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Nokia gives you certain additional
+ ** rights. These rights are described in the Nokia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** If you have questions regarding the use of this file, please contact
+ ** Nokia at qt-info@nokia.com.
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#define QT_FONTS_ARE_RESOURCES
+
+/* Data structures */
+#ifndef QT_NO_QUUID_STRING
+# define QT_NO_QUUID_STRING
+#endif
+#ifndef QT_NO_STL
+# define QT_NO_STL
+#endif
+#ifndef QT_NO_TEXTDATE
+# define QT_NO_TEXTDATE
+#endif
+#ifndef QT_NO_DATESTRING
+# define QT_NO_DATESTRING
+#endif
+
+/* Dialogs */
+#ifndef QT_NO_FILEDIALOG
+# define QT_NO_FILEDIALOG
+#endif
+#ifndef QT_NO_PRINTDIALOG
+# define QT_NO_PRINTDIALOG
+#endif
+#ifndef QT_NO_PRINTPREVIEWDIALOG
+# define QT_NO_PRINTPREVIEWDIALOG
+#endif
+
+
+/* File I/O */
+#ifndef QT_NO_DOM
+# define QT_NO_DOM
+#endif
+#ifndef QT_NO_FILESYSTEMWATCHER
+# define QT_NO_FILESYSTEMWATCHER
+#endif
+#ifndef QT_NO_FSFILEENGINE
+# define QT_NO_FSFILEENGINE
+#endif
+#ifndef QT_NO_FILESYSTEMMODEL
+# define QT_NO_FILESYSTEMMODEL
+#endif
+#ifndef QT_NO_FILESYSTEMMODEL
+# define QT_NO_FILESYSTEMMODEL
+#endif
+#ifndef QT_NO_PROCESS
+# define QT_NO_PROCESS
+#endif
+#ifndef QT_NO_TEMPORARYFILE
+# define QT_NO_TEMPORARYFILE
+#endif
+#ifndef QT_NO_SETTINGS
+# define QT_NO_SETTINGS
+#endif
+#ifndef QT_NO_LIBRARY
+# define QT_NO_LIBRARY
+#endif
+
+/* Fonts */
+#ifndef QT_NO_QWS_QPF2
+# define QT_NO_QWS_QPF2
+#endif
+
+/* Images */
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+# define QT_NO_IMAGEFORMATPLUGIN
+#endif
+#ifndef QT_NO_IMAGE_HEURISTIC_MASK
+# define QT_NO_IMAGE_HEURISTIC_MASK
+#endif
+#ifndef QT_NO_IMAGE_TEXT
+# define QT_NO_IMAGE_TEXT
+#endif
+#ifndef QT_NO_MOVIE
+# define QT_NO_MOVIE
+#endif
+
+/* Internationalization */
+#ifndef QT_NO_BIG_CODECS
+# define QT_NO_BIG_CODECS
+#endif
+#ifndef QT_NO_QWS_INPUTMETHODS
+# define QT_NO_QWS_INPUTMETHODS
+#endif
+#ifndef QT_NO_TEXTCODEC
+# define QT_NO_TEXTCODEC
+#endif
+#ifndef QT_NO_CODECS
+# define QT_NO_CODECS
+#endif
+#ifndef QT_NO_TEXTCODECPLUGIN
+# define QT_NO_TEXTCODECPLUGIN
+#endif
+#ifndef QT_NO_TRANSLATION
+# define QT_NO_TRANSLATION
+#endif
+#ifndef QT_NO_TRANSLATION_UTF8
+# define QT_NO_TRANSLATION_UTF8
+#endif
+
+/* ItemViews */
+
+#ifndef QT_NO_DIRMODEL
+# define QT_NO_DIRMODEL
+#endif
+
+/* Kernel */
+#ifndef QT_NO_CLIPBOARD
+# define QT_NO_CLIPBOARD
+#endif
+#ifndef QT_NO_CSSPARSER
+# define QT_NO_CSSPARSER
+#endif
+#ifndef QT_NO_CURSOR
+# define QT_NO_CURSOR
+#endif
+#ifndef QT_NO_DRAGANDDROP
+# define QT_NO_DRAGANDDROP
+#endif
+#ifndef QT_NO_EFFECTS
+# define QT_NO_EFFECTS
+#endif
+#ifndef QT_NO_SESSIONMANAGER
+# define QT_NO_SESSIONMANAGER
+#endif
+#ifndef QT_NO_SHAREDMEMORY
+# define QT_NO_SHAREDMEMORY
+#endif
+#ifndef QT_NO_SOUND
+# define QT_NO_SOUND
+#endif
+#ifndef QT_NO_SYSTEMLOCALE
+# define QT_NO_SYSTEMSEMAPHORE
+#endif
+#ifndef QT_NO_SYSTEMSEMAPHORE
+# define QT_NO_SYSTEMSEMAPHORE
+#endif
+#ifndef QT_NO_TABLETEVENT
+# define QT_NO_TABLETEVENT
+#endif
+#ifndef QT_NO_CRASHHANDLER
+# define QT_NO_CRASHHANDLER
+#endif
+#ifndef QT_NO_CONCURRENT
+# define QT_NO_CONCURRENT
+#endif
+#ifndef QT_NO_XMLSTREAM
+# define QT_NO_XMLSTREAM
+#endif
+#ifndef QT_NO_XMLSTREAMREADER
+# define QT_NO_XMLSTREAMREADER
+#endif
+#ifndef QT_NO_XMLSTREAMWRITER
+# define QT_NO_XMLSTREAMWRITER
+#endif
+
+/* Networking */
+#ifndef QT_NO_COP
+# define QT_NO_COP
+#endif
+#ifndef QT_NO_HOSTINFO
+# define QT_NO_HOSTINFO
+#endif
+#ifndef QT_NO_HTTP
+# define QT_NO_HTTP
+#endif
+#ifndef QT_NO_NETWORKPROXY
+# define QT_NO_NETWORKPROXY
+#endif
+#ifndef QT_NO_SOCKS5
+# define QT_NO_SOCKS5
+#endif
+#ifndef QT_NO_UDPSOCKET
+# define QT_NO_UDPSOCKET
+#endif
+#ifndef QT_NO_URLINFO
+# define QT_NO_URLINFO
+#endif
+#ifndef QT_NO_FTP
+# define QT_NO_FTP
+#endif
+
+/* Painting */
+#ifndef QT_NO_COLORNAMES
+# define QT_NO_COLORNAMES
+#endif
+#ifndef QT_NO_DIRECTPAINTER
+# define QT_NO_DIRECTPAINTER
+#endif
+#ifndef QT_NO_PAINTONSCREEN
+# define QT_NO_PAINTONSCREEN
+#endif
+#ifndef QT_NO_PAINT_DEBUG
+# define QT_NO_PAINT_DEBUG
+#endif
+#ifndef QT_NO_PICTURE
+# define QT_NO_PICTURE
+#endif
+#ifndef QT_NO_PRINTER
+# define QT_NO_PRINTER
+#endif
+#ifndef QT_NO_CUPS
+# define QT_NO_CUPS
+#endif
+
+/* Qt for Embedded Linux */
+#ifndef QT_NO_QWSEMBEDWIDGET
+# define QT_NO_QWSEMBEDWIDGET
+#endif
+#ifndef QT_NO_QWS_ALPHA_CURSOR
+# define QT_NO_QWS_ALPHA_CURSOR
+#endif
+#ifndef QT_NO_QWS_CURSOR
+# define QT_NO_QWS_CURSOR
+#endif
+#ifndef QT_NO_QWS_DECORATION_DEFAULT
+# define QT_NO_QWS_DECORATION_DEFAULT
+#endif
+#ifndef QT_NO_QWS_DECORATION_STYLED
+# define QT_NO_QWS_DECORATION_STYLED
+#endif
+#ifndef QT_NO_QWS_DECORATION_WINDOWS
+# define QT_NO_QWS_DECORATION_WINDOWS
+#endif
+#ifndef QT_NO_QWS_MANAGER
+# define QT_NO_QWS_MANAGER
+#endif
+#ifndef QT_NO_QWS_KEYBOARD
+# define QT_NO_QWS_KEYBOARD
+#endif
+#ifndef QT_NO_QWS_MOUSE
+# define QT_NO_QWS_MOUSE
+#endif
+#ifndef QT_NO_QWS_MOUSE_AUTO
+# define QT_NO_QWS_MOUSE_AUTO
+#endif
+#ifndef QT_NO_QWS_MOUSE_MANUAL
+# define QT_NO_QWS_MOUSE_MANUAL
+#endif
+#ifndef QT_NO_QWS_MULTIPROCESS
+# define QT_NO_QWS_MULTIPROCESS
+#endif
+#ifndef QT_NO_QWS_SOUNDSERVER
+# define QT_NO_QWS_SOUNDSERVER
+#endif
+#ifndef QT_NO_SXE
+# define QT_NO_SXE
+#endif
+#ifndef QT_NO_QWS_PROPERTIES
+# define QT_NO_QWS_PROPERTIES
+#endif
+#ifndef QT_NO_QWS_PROXYSCREEN
+# define QT_NO_QWS_PROXYSCREEN
+#endif
+#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION
+# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION
+#endif
+#ifndef QT_NO_QWS_LINUXFB
+# define QT_NO_QWS_LINUXFB
+#endif
+#ifndef QT_NO_QWS_MOUSE_PC
+# define QT_NO_QWS_MOUSE_PC
+#endif
+#ifndef QT_NO_QWS_MOUSE_LINUXTP
+# define QT_NO_QWS_MOUSE_LINUXTP
+#endif
+#ifndef QT_NO_QWS_QPF
+# define QT_NO_QWS_QPF
+#endif
+
+/* SVG */
+#ifndef QT_NO_SVG
+# define QT_NO_SVG
+#endif
+#ifndef QT_NO_GRAPHICSSVGITEM
+# define QT_NO_GRAPHICSSVGITEM
+#endif
+#ifndef QT_NO_SVGGENERATOR
+# define QT_NO_SVGGENERATOR
+#endif
+#ifndef QT_NO_SVGRENDERER
+# define QT_NO_SVGRENDERER
+#endif
+#ifndef QT_NO_SVGWIDGET
+# define QT_NO_SVGWIDGET
+#endif
+
+/* Styles */
+#ifndef QT_NO_STYLE_MOTIF
+# define QT_NO_STYLE_MOTIF
+#endif
+#ifndef QT_NO_STYLE_CDE
+# define QT_NO_STYLE_CDE
+#endif
+#ifndef QT_NO_STYLE_STYLESHEET
+# define QT_NO_STYLE_STYLESHEET
+#endif
+#ifndef QT_NO_STYLE_WINDOWSCE
+# define QT_NO_STYLE_WINDOWSCE
+#endif
+#ifndef QT_NO_STYLE_WINDOWSMOBILE
+# define QT_NO_STYLE_WINDOWSMOBILE
+#endif
+#ifndef QT_NO_STYLE_WINDOWSVISTA
+# define QT_NO_STYLE_WINDOWSVISTA
+#endif
+#ifndef QT_NO_STYLE_WINDOWSXP
+# define QT_NO_STYLE_WINDOWSXP
+#endif
+
+/* Utilities */
+#ifndef QT_NO_ACCESSIBILITY
+# define QT_NO_ACCESSIBILITY
+#endif
+#ifndef QT_NO_COMPLETER
+# define QT_NO_COMPLETER
+#endif
+#ifndef QT_NO_DESKTOPSERVICES
+# define QT_NO_DESKTOPSERVICES
+#endif
+#ifndef QT_NO_SCRIPT
+# define QT_NO_SCRIPT
+#endif
+#ifndef QT_NO_SYSTEMTRAYICON
+# define QT_NO_SYSTEMTRAYICON
+#endif
+
+/* Windows */
+#ifndef QT_NO_WIN_ACTIVEQT
+# define QT_NO_WIN_ACTIVEQT
+#endif
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index ca3219f16c..45153b8b53 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -216,6 +216,8 @@ namespace QT_NAMESPACE {}
# define Q_OS_ULTRIX
#elif defined(sinix)
# define Q_OS_RELIANT
+#elif defined(__native_client__)
+# define Q_OS_NACL
#elif defined(__linux__) || defined(__linux)
# define Q_OS_LINUX
#elif defined(__FreeBSD__) || defined(__DragonFly__)
@@ -2661,6 +2663,10 @@ QT_LICENSED_MODULE(DBus)
# define QT_NO_PROCESS
#endif
+#ifdef Q_OS_NACL
+#include <qnaclunimplemented.h>
+#endif
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/global/qnaclunimplemented.cpp b/src/corelib/global/qnaclunimplemented.cpp
new file mode 100644
index 0000000000..618ff3e082
--- /dev/null
+++ b/src/corelib/global/qnaclunimplemented.cpp
@@ -0,0 +1,156 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ ** All rights reserved.
+ ** Contact: Nokia Corporation (qt-info@nokia.com)
+ **
+ ** This file is part of the QtCore module of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:LGPL$
+ ** No Commercial Usage
+ ** This file contains pre-release code and may not be distributed.
+ ** You may use this file in accordance with the terms and conditions
+ ** contained in the Technology Preview License Agreement accompanying
+ ** this package.
+ **
+ ** GNU Lesser General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU Lesser
+ ** General Public License version 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Nokia gives you certain additional
+ ** rights. These rights are described in the Nokia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** If you have questions regarding the use of this file, please contact
+ ** Nokia at qt-info@nokia.com.
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include "qnaclunimplemented.h"
+#include <pthread.h>
+#include <qglobal.h>
+
+/*
+ The purpose of this file is to stub out certain functions
+ that are not provided by the Native Client SDK. This is
+ done as an alterative to sprinkling the Qt sources with
+ NACL ifdefs.
+
+ There are two main classes of functions:
+
+ - Fuctions that are called but can have no effect:
+ For these we simply give an empty implementation
+
+ - Functions that are referenced in the source code, but
+ is not/must not be called at run-time:
+ These we either leave undefined or implement with a
+ qFatal.
+
+ This is a work in progress.
+*/
+
+extern "C" {
+
+void pthread_cleanup_push(void (*)(void *), void *)
+{
+
+}
+
+void pthread_cleanup_pop(int)
+{
+
+}
+
+int pthread_setcancelstate(int, int *)
+{
+ return 0;
+}
+
+int pthread_setcanceltype(int, int *)
+{
+ return 0;
+}
+
+void pthread_testcancel(void)
+{
+
+}
+
+
+int pthread_cancel(pthread_t)
+{
+ return 0;
+}
+
+int pthread_attr_setinheritsched(pthread_attr_t *,int)
+{
+ return 0;
+}
+
+
+int pthread_attr_getinheritsched(const pthread_attr_t *, int *)
+{
+ return 0;
+}
+
+// event dispatcher, select
+//struct fd_set;
+//struct timeval;
+
+int fcntl(int, int, ...)
+{
+ return 0;
+}
+
+int sigaction(int, const struct sigaction *, struct sigaction *)
+{
+ return 0;
+}
+
+int open(const char *, int, ...)
+{
+ return 0;
+}
+
+int open64(const char *, int, ...)
+{
+ return 0;
+}
+
+int access(const char *, int)
+{
+ return 0;
+}
+
+typedef long off64_t;
+off64_t ftello64(void *)
+{
+ qFatal("ftello64 called");
+ return 0;
+}
+
+off64_t lseek64(int, off_t, int)
+{
+ qFatal("lseek64 called");
+ return 0;
+}
+
+} // Extern C
+
+int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
+{
+ return 0;
+}
diff --git a/src/corelib/global/qnaclunimplemented.h b/src/corelib/global/qnaclunimplemented.h
new file mode 100644
index 0000000000..84085b5b1e
--- /dev/null
+++ b/src/corelib/global/qnaclunimplemented.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ ** All rights reserved.
+ ** Contact: Nokia Corporation (qt-info@nokia.com)
+ **
+ ** This file is part of the QtCore module of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:LGPL$
+ ** No Commercial Usage
+ ** This file contains pre-release code and may not be distributed.
+ ** You may use this file in accordance with the terms and conditions
+ ** contained in the Technology Preview License Agreement accompanying
+ ** this package.
+ **
+ ** GNU Lesser General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU Lesser
+ ** General Public License version 2.1 as published by the Free Software
+ ** Foundation and appearing in the file LICENSE.LGPL included in the
+ ** packaging of this file. Please review the following information to
+ ** ensure the GNU Lesser General Public License version 2.1 requirements
+ ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+ **
+ ** In addition, as a special exception, Nokia gives you certain additional
+ ** rights. These rights are described in the Nokia Qt LGPL Exception
+ ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+ **
+ ** If you have questions regarding the use of this file, please contact
+ ** Nokia at qt-info@nokia.com.
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#ifndef QNACLUNIMPLEMENTED_H
+#define QNACLUNIMPLEMENTED_H
+
+#ifdef Q_OS_NACL
+
+// pthread
+#include <pthread.h>
+#define PTHREAD_CANCEL_DISABLE 1
+#define PTHREAD_CANCEL_ENABLE 2
+#define PTHREAD_INHERIT_SCHED 3
+
+extern "C" {
+
+void pthread_cleanup_push(void (*handler)(void *), void *arg);
+void pthread_cleanup_pop(int execute);
+
+int pthread_setcancelstate(int state, int *oldstate);
+int pthread_setcanceltype(int type, int *oldtype);
+void pthread_testcancel(void);
+int pthread_cancel(pthread_t thread);
+
+int pthread_attr_setinheritsched(pthread_attr_t *attr,
+ int inheritsched);
+int pthread_attr_getinheritsched(const pthread_attr_t *attr,
+ int *inheritsched);
+
+// event dispatcher, select
+//struct fd_set;
+//struct timeval;
+int fcntl(int fildes, int cmd, ...);
+int sigaction(int sig, const struct sigaction * act, struct sigaction * oact);
+
+typedef long off64_t;
+off64_t ftello64(void *stream);
+off64_t lseek64(int fildes, off_t offset, int whence);
+int open64(const char *path, int oflag, ...);
+
+}
+
+int select(int nfds, fd_set * readfds, fd_set * writefds, fd_set * errorfds, struct timeval * timeout);
+
+#endif //Q_OS_NACL
+
+#endif //QNACLUNIMPLEMENTED_H
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index ef448b1d7e..7c14886d1c 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -69,7 +69,7 @@ win32 {
SOURCES += io/qfsfileengine_iterator_unix.cpp
symbian:SOURCES += io/qprocess_symbian.cpp
else:SOURCES += io/qprocess_unix.cpp
- macx-*: {
+ !nacl:macx-*: {
HEADERS += io/qfilesystemwatcher_fsevents_p.h
SOURCES += io/qsettings_mac.cpp io/qfilesystemwatcher_fsevents.cpp
}
@@ -84,9 +84,11 @@ win32 {
io/qfilesystemwatcher_dnotify_p.h
}
- freebsd-*|macx-*|darwin-*|openbsd-*:{
- SOURCES += io/qfilesystemwatcher_kqueue.cpp
- HEADERS += io/qfilesystemwatcher_kqueue_p.h
+ !nacl {
+ freebsd-*|macx-*|darwin-*|openbsd-*:{
+ SOURCES += io/qfilesystemwatcher_kqueue.cpp
+ HEADERS += io/qfilesystemwatcher_kqueue_p.h
+ }
}
symbian {
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 8e76e9e0a0..783fbb020d 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && ! defined (Q_OS_NACL)
#define QT_USE_MMAP
#endif
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 1851e04b77..6f53a3f0f0 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -78,12 +78,12 @@ wince*: {
kernel/qfunctions_wince.h
}
-mac:!embedded {
+mac:!embedded:!embedded_lite {
SOURCES += \
kernel/qcoreapplication_mac.cpp
}
-mac {
+mac:!nacl {
SOURCES += \
kernel/qcore_mac.cpp
}
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index e0d92c047b..685576bc73 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -42,7 +42,8 @@
#include "qcore_unix_p.h"
#include "qelapsedtimer.h"
-#ifndef Q_OS_VXWORKS
+#ifdef Q_OS_NACL
+#elif !defined (Q_OS_VXWORKS)
# if !defined(Q_OS_HPUX) || defined(__ia64)
# include <sys/select.h>
# endif
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index f7d45aca21..0c336e7947 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -112,7 +112,9 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
bool pipefail = false;
// initialize the common parts of the event loop
-#if defined(Q_OS_INTEGRITY)
+#if defined(Q_OS_NACL)
+ // do nothing.
+#elif defined(Q_OS_INTEGRITY)
// INTEGRITY doesn't like a "select" on pipes, so use socketpair instead
if (socketpair(AF_INET, SOCK_STREAM, PF_INET, thread_pipe) == -1) {
perror("QEventDispatcherUNIXPrivate(): Unable to create socket pair");
@@ -157,7 +159,9 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate()
{
-#if defined(Q_OS_VXWORKS)
+#if defined(Q_OS_NACL)
+ // do nothing.
+#elif defined(Q_OS_VXWORKS)
close(thread_pipe[0]);
char name[20];
@@ -312,7 +316,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
QTimerInfoList::QTimerInfoList()
{
-#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC)
+#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_NACL)
if (!QElapsedTimer::isMonotonic()) {
// not using monotonic timers, initialize the timeChanged() machinery
previousTime = qt_gettime();
@@ -364,6 +368,10 @@ timeval qAbs(const timeval &t)
*/
bool QTimerInfoList::timeChanged(timeval *delta)
{
+#ifdef Q_OS_NACL
+ Q_UNUSED(delta)
+ return false; // Calling "times" crashes.
+#endif
struct tms unused;
clock_t currentTicks = times(&unused);
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index cbe58de795..d38acf3aa5 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -64,7 +64,7 @@
# include <sys/times.h>
#else
# include <sys/time.h>
-# if !defined(Q_OS_HPUX) || defined(__ia64)
+# if (!defined(Q_OS_HPUX) || defined(__ia64)) && !defined(Q_OS_NACL)
# include <sys/select.h>
# endif
#endif
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 6b34b5f760..47a13d7dbd 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -457,6 +457,7 @@ void QThread::usleep(unsigned long usecs)
// Does some magic and calculate the Unix scheduler priorities
// sched_policy is IN/OUT: it must be set to a valid policy before calling this function
// sched_priority is OUT only
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && !defined(Q_OS_SYMBIAN) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_priority)
{
#ifdef SCHED_IDLE
@@ -484,6 +485,7 @@ static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_pr
*sched_priority = prio;
return true;
}
+#endif
void QThread::start(Priority priority)
{
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 4e0ebbcb3d..f540f14cf8 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -83,7 +83,7 @@ SOURCES += \
symbian:SOURCES+=tools/qlocale_symbian.cpp
-mac:SOURCES += tools/qelapsedtimer_mac.cpp
+!nacl:mac:SOURCES += tools/qelapsedtimer_mac.cpp
else:symbian:SOURCES += tools/qelapsedtimer_symbian.cpp
else:unix:SOURCES += tools/qelapsedtimer_unix.cpp
else:win32:SOURCES += tools/qelapsedtimer_win.cpp