Inhibited wrong occurrence of ad-hoc encoding of 64bit doubles on iOS

This commit is contained in:
Simone Pierazzini 2015-04-16 16:02:17 +02:00
parent dcdc51ce30
commit 2f9912a012
4 changed files with 13 additions and 4 deletions

View File

@ -608,7 +608,10 @@ inline packer<Stream>& packer<Stream>::pack_double(double d)
mem.f = d;
char buf[9];
buf[0] = static_cast<char>(0xcbu);
#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
#if defined(TARGET_OS_IPHONE)
// ok
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
// https://github.com/msgpack/msgpack-perl/pull/1
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
#endif

View File

@ -669,7 +669,9 @@ msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
union { double f; uint64_t i; } mem;
mem.f = d;
buf[0] = 0xcb;
#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
#if defined(TARGET_OS_IPHONE)
// ok
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
// https://github.com/msgpack/msgpack-perl/pull/1
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
#endif

View File

@ -721,7 +721,9 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
case MSGPACK_CS_DOUBLE: {
union { uint64_t i; double f; } mem;
load<uint64_t>(mem.i, n);
#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
#if defined(TARGET_OS_IPHONE)
// ok
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
// https://github.com/msgpack/msgpack-perl/pull/1
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
#endif

View File

@ -270,7 +270,9 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
case MSGPACK_CS_DOUBLE: {
union { uint64_t i; double f; } mem;
_msgpack_load64(uint64_t, n, &mem.i);
#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
#if defined(TARGET_OS_IPHONE)
// ok
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
// https://github.com/msgpack/msgpack-perl/pull/1
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
#endif