summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/endian/endiantest.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-02-24 11:11:02 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-02 14:48:00 +0100
commit17ddce4692b31af4374b28cd40b9f25e8ed629cd (patch)
tree773832a8b53104941f5a9744535e41c5f68858f6 /config.tests/unix/endian/endiantest.cpp
parent62a654cc902197cc99326879076ba53b6509dc67 (diff)
Remove Q_BYTE_ORDER and -*-endian arguments from configures
Do not write Q_BYTE_ORDER to qconfig.h in the configures. Instead, we #define Q_BYTE_ORDER in qprocessordetection.h, since many CPUs only support a single endian format. For bi-endian processors, we set Q_BYTE_ORDER depending on how the preprocessor sets __BYTE_ORDER__, __BIG_ENDIAN__, or __LITTLE_ENDIAN__ (instead of using a compile test to do so). For operating systems that only support a single byte order, we can check for Q_OS_* in addition to the preprocessor macros above. This is possible because qprocessordetection.h is included by qglobal.h after Q_OS_* and Q_CC_* detection has been done. Do this for Windows CE, which is always little- endian according to MSDN. Change-Id: I019a95e05252ef69895c4b38fbfa6ebfb6a943cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'config.tests/unix/endian/endiantest.cpp')
-rw-r--r--config.tests/unix/endian/endiantest.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/config.tests/unix/endian/endiantest.cpp b/config.tests/unix/endian/endiantest.cpp
deleted file mode 100644
index e08a11b944..0000000000
--- a/config.tests/unix/endian/endiantest.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the config.tests 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$
-**
-****************************************************************************/
-
-// "MostSignificantByteFirst"
-short msb_bigendian[] = { 0x0000, 0x4d6f, 0x7374, 0x5369, 0x676e, 0x6966, 0x6963, 0x616e, 0x7442, 0x7974, 0x6546, 0x6972, 0x7374, 0x0000 };
-
-// "LeastSignificantByteFirst"
-short lsb_littleendian[] = { 0x0000, 0x654c, 0x7361, 0x5374, 0x6769, 0x696e, 0x6966, 0x6163, 0x746e, 0x7942, 0x6574, 0x6946, 0x7372, 0x0074, 0x0000 };
-
-int main(int, char **)
-{
- // make sure the linker doesn't throw away the arrays
- void (*msb_bigendian_string)() = (void (*)())msb_bigendian;
- void (*lsb_littleendian_string)() = (void (*)())lsb_littleendian;
- (void)msb_bigendian_string();
- (void)lsb_littleendian_string();
- return msb_bigendian[1] == lsb_littleendian[1];
-}