Remove qatomic_arch.h
authorBradley T. Hughes <bradley.hughes@nokia.com>
Mon, 13 Feb 2012 05:49:56 +0000 (06:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 13 Feb 2012 21:15:40 +0000 (22:15 +0100)
Make qbasicatomic.h include the OS/compiler/processor dependent
implementation.

For implementations that have not yet been ported to declare a
QAtomicOps, they need to #include <QtCore/qoldbasicatomic.h>, and the
new QBasicAtomicInteger and QBasicAtomicPointer should not be declared.

Change-Id: Ia951834484c9f8dfa75131592e5e716b68ff989b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 files changed:
src/corelib/arch/arch.pri
src/corelib/arch/qatomic_alpha.h
src/corelib/arch/qatomic_arch.h [deleted file]
src/corelib/arch/qatomic_bfin.h
src/corelib/arch/qatomic_integrity.h
src/corelib/arch/qatomic_powerpc.h
src/corelib/arch/qatomic_s390.h
src/corelib/arch/qatomic_sh4a.h
src/corelib/arch/qatomic_sparc.h
src/corelib/arch/qatomic_vxworks.h
src/corelib/thread/qbasicatomic.h
src/corelib/thread/qoldbasicatomic.h

index 825df37..2a4fddb 100644 (file)
@@ -13,7 +13,6 @@ integrity:HEADERS += arch/qatomic_integrity.h
 !wince*:!win32:!mac:HEADERS += arch/qatomic_alpha.h \
                        arch/qatomic_ia64.h \
                        arch/qatomic_sparc.h \
-                       arch/qatomic_arch.h \
                        arch/qatomic_powerpc.h \
                        arch/qatomic_armv5.h \
                        arch/qatomic_armv6.h \
index 7954644..0ac2d8d 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_ALPHA_H
 #define QATOMIC_ALPHA_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
deleted file mode 100644 (file)
index 9219ad1..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QATOMIC_ARCH_H
-#define QATOMIC_ARCH_H
-
-QT_BEGIN_HEADER
-
-#include "QtCore/qglobal.h"
-
-#if defined(QT_ARCH_INTEGRITY)
-#  include "QtCore/qatomic_integrity.h"
-#elif defined(QT_ARCH_VXWORKS)
-#  include "QtCore/qatomic_vxworks.h"
-#elif defined(QT_ARCH_ALPHA)
-#  include "QtCore/qatomic_alpha.h"
-#elif defined(QT_ARCH_BFIN)
-#  include "QtCore/qatomic_bfin.h"
-#elif defined(QT_ARCH_POWERPC)
-#  include "QtCore/qatomic_powerpc.h"
-#elif defined(QT_ARCH_S390)
-#  include "QtCore/qatomic_s390.h"
-#elif defined(QT_ARCH_SPARC)
-#  include "QtCore/qatomic_sparc.h"
-#elif defined(QT_ARCH_SH4A)
-#  include "QtCore/qatomic_sh4a.h"
-#else
-#  error "Qt has not been ported to this architecture"
-#endif
-
-QT_END_HEADER
-
-#endif // QATOMIC_ARCH_H
index 530ac8d..28a5cd6 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_BFIN_H
 #define QATOMIC_BFIN_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
index e5d226a..f290984 100644 (file)
@@ -42,6 +42,7 @@
 #ifndef QATOMIC_INTEGRITY_H
 #define QATOMIC_INTEGRITY_H
 
+#include <QtCore/qoldbasicatomic.h>
 #include <INTEGRITY.h>
 
 QT_BEGIN_HEADER
index f03539d..10f6e4c 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_POWERPC_H
 #define QATOMIC_POWERPC_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
index b6246e8..ef7ab34 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_S390_H
 #define QATOMIC_S390_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
index 042a602..d00b9ad 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_SH4A_H
 #define QATOMIC_SH4A_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
index 5fc640e..6328229 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QATOMIC_SPARC_H
 #define QATOMIC_SPARC_H
 
+#include <QtCore/qoldbasicatomic.h>
+
 QT_BEGIN_HEADER
 
 QT_BEGIN_NAMESPACE
index c18563e..dbec16a 100644 (file)
@@ -48,6 +48,8 @@ QT_BEGIN_HEADER
 #  include <QtCore/qatomic_powerpc.h>
 #else // generic implementation with taskLock()
 
+#include <QtCore/qoldbasicatomic.h>
+
 #if 0
 // we don't want to include the system header here for two function prototypes,
 // because it pulls in a _lot_ of stuff that pollutes the global namespace
index fee7561..ba9e30b 100644 (file)
 
 #if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED)
 #  include <QtCore/qatomic_bootstrap.h>
+
+// Compiler dependent implementation
 #elif defined(Q_CC_MSVC)
 #  include <QtCore/qatomic_msvc.h>
+
+// Operating system dependent implementation
+#elif defined(Q_OS_INTEGRITY)
+#  include "QtCore/qatomic_integrity.h"
+#elif defined(Q_OS_VXWORKS)
+#  include "QtCore/qatomic_vxworks.h"
+
+// Processor dependent implementation
+#elif defined(Q_PROCESSOR_ALPHA)
+#  include "QtCore/qatomic_alpha.h"
 #elif defined(Q_PROCESSOR_ARM_V7)
 # include "QtCore/qatomic_armv7.h"
 #elif defined(Q_PROCESSOR_ARM_V6)
 # include "QtCore/qatomic_armv6.h"
 #elif defined(Q_PROCESSOR_ARM_V5)
 # include "QtCore/qatomic_armv5.h"
+#elif defined(Q_PROCESSOR_BFIN)
+#  include "QtCore/qatomic_bfin.h"
 #elif defined(Q_PROCESSOR_IA64)
 #  include "QtCore/qatomic_ia64.h"
 #elif defined(Q_PROCESSOR_MIPS)
 #  include "QtCore/qatomic_mips.h"
+#elif defined(Q_PROCESSOR_POWERPC)
+#  include "QtCore/qatomic_powerpc.h"
+#elif defined(Q_PROCESSOR_S390)
+#  include "QtCore/qatomic_s390.h"
+#elif defined(Q_PROCESSOR_SH4A)
+#  include "QtCore/qatomic_sh4a.h"
+#elif defined(Q_PROCESSOR_SPARC)
+#  include "QtCore/qatomic_sparc.h"
 #elif defined(Q_PROCESSOR_X86_32)
 #  include <QtCore/qatomic_i386.h>
 #elif defined(Q_PROCESSOR_X86_64)
 #  include <QtCore/qatomic_x86_64.h>
+
+// Fallback compiler dependent implementation
 #elif defined(Q_COMPILER_ATOMICS) && defined(Q_COMPILER_CONSTEXPR)
 #  include <QtCore/qatomic_cxx11.h>
 #elif defined(Q_CC_GNU)
 #  include <QtCore/qatomic_gcc.h>
+
+// No fallback
 #else
-#  define QT_OLD_ATOMICS
+#  error "Qt has not been ported to this platform"
 #endif
 
-#ifdef QT_OLD_ATOMICS
-# include "QtCore/qoldbasicatomic.h"
-# undef QT_OLD_ATOMICS
-#else
+// Only include if the implementation has been ported to QAtomicOps
+#ifndef QOLDBASICATOMIC_H
 
 QT_BEGIN_HEADER
 
@@ -234,7 +258,6 @@ QT_END_NAMESPACE
 
 QT_END_HEADER
 
-#endif // QT_OLD_ATOMICS
-
+#endif // QOLDBASICATOMIC_H
 
-#endif // QBASIC_ATOMIC
+#endif // QBASICATOMIC_H
index 7482d95..4df07ad 100644 (file)
@@ -144,6 +144,4 @@ public:
 QT_END_NAMESPACE
 QT_END_HEADER
 
-#  include <QtCore/qatomic_arch.h>
-
-#endif // QBASIC_ATOMIC
+#endif // QOLDBASICATOMIC_H