diff options
Diffstat (limited to 'src/3rdparty/double-conversion/utils.h')
-rw-r--r-- | src/3rdparty/double-conversion/utils.h | 32 |
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)); |