mdbx: fix 'magic' bug.

This commit is contained in:
Leo Yuriev 2017-05-25 14:56:07 +03:00
parent 89b5b53193
commit b94e761d73
2 changed files with 8 additions and 5 deletions

View File

@ -984,7 +984,7 @@ static __inline pgno_t NODEPGNO(const MDBX_node *node) {
if (sizeof(pgno_t) > 4)
pgno &= UINT64_C(0xffffFFFFffff);
} else {
pgno = node->mn_lo | ((pgno_t)node->mn_lo << 16);
pgno = node->mn_lo | ((pgno_t)node->mn_hi << 16);
if (sizeof(pgno_t) > 4)
pgno |= ((uint64_t)node->mn_flags) << 32;
}

View File

@ -113,11 +113,14 @@ typedef pthread_mutex_t mdbx_fastmutex_t;
#include <sys/file.h>
#endif
#if defined(__i386) || defined(__x86_64) || defined(_M_IX86)
#define UNALIGNED_OK 1 /* TODO */
#endif
#ifndef UNALIGNED_OK
#if !defined(UNALIGNED_OK)
#if defined(__i386) || defined(__x86_64__) || defined(_M_IX86) || \
defined(_M_X64) || defined(i386) || defined(_X86_) || defined(__i386__) || \
defined(_X86_64_)
#define UNALIGNED_OK 1
#else
#define UNALIGNED_OK 0
#endif
#endif /* UNALIGNED_OK */
#if (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF