aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/double-conversion/utils.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-22 12:53:09 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-24 12:39:02 +0100
commit998860f00ca1c9eb333787595e05e8cb486802c8 (patch)
treecf1dc15635797fd3283f1ee8e87bc1fd4bb1b693 /src/3rdparty/double-conversion/utils.h
parent9fb297a54bd0226b4827b5d7ca093a7f9c4922fa (diff)
Update our double conversion code to the latest release from code.google.com
This fixes AArch64 builds and brings us in sync with upstream commit 2fb03de56faa32bbba5e02222528e7b760f71d77 Task-number: QTBUG-35528 Change-Id: Ib356627e06c1fecaa5b3f66d0a98fb5b30dc87e5 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/double-conversion/utils.h')
-rw-r--r--src/3rdparty/double-conversion/utils.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/3rdparty/double-conversion/utils.h b/src/3rdparty/double-conversion/utils.h
index 1eca476913..886017d2aa 100644
--- a/src/3rdparty/double-conversion/utils.h
+++ b/src/3rdparty/double-conversion/utils.h
@@ -33,17 +33,14 @@
#include <assert.h>
#ifndef ASSERT
-# if defined(WINCE) || defined(_WIN32_WCE)
-# define ASSERT(condition)
-# else
-# define ASSERT(condition) (assert(condition))
-# endif
+#define ASSERT(condition) \
+ assert(condition);
#endif
#ifndef UNIMPLEMENTED
-# define UNIMPLEMENTED() (exit(-1))
+#define UNIMPLEMENTED() (abort())
#endif
#ifndef UNREACHABLE
-# define UNREACHABLE() (exit(-1))
+#define UNREACHABLE() (abort())
#endif
// Double operations detection based on target architecture.
@@ -57,12 +54,14 @@
// disabled.)
// On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
#if defined(_M_X64) || defined(__x86_64__) || \
- defined(__ARMEL__) || defined(__avr32__) || _M_ARM_FP || \
+ defined(__ARMEL__) || defined(__avr32__) || \
defined(__hppa__) || defined(__ia64__) || \
- defined(__mips__) || defined(__powerpc__) || \
+ defined(__mips__) || \
+ defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
defined(__SH4__) || defined(__alpha__) || \
- defined(_MIPS_ARCH_MIPS32R2)
+ defined(_MIPS_ARCH_MIPS32R2) || \
+ defined(__AARCH64EL__)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
#if defined(_WIN32)
@@ -71,12 +70,15 @@
#else
#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
#endif // _WIN32
-#elif defined(WINCE) || defined(_WIN32_WCE)
-#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#else
#error Target architecture was not detected as supported by Double-Conversion.
#endif
+#if defined(__GNUC__)
+#define DOUBLE_CONVERSION_UNUSED __attribute__((unused))
+#else
+#define DOUBLE_CONVERSION_UNUSED
+#endif
#if defined(_WIN32) && !defined(__MINGW32__)
@@ -96,6 +98,8 @@ typedef unsigned __int64 uint64_t;
#endif
+typedef uint16_t uc16;
+
// The following macro works on both 32 and 64-bit platforms.
// Usage: instead of writing 0x1234567890123456
// write UINT64_2PART_C(0x12345678,90123456);
@@ -302,8 +306,8 @@ template <class Dest, class Source>
inline Dest BitCast(const Source& source) {
// Compile time assertion: sizeof(Dest) == sizeof(Source)
// A compile error here means your Dest and Source have different sizes.
- char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
- (void) VerifySizesAreEqual;
+ DOUBLE_CONVERSION_UNUSED
+ typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
Dest dest;
memmove(&dest, &source, sizeof(dest));