mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx: fix 'magic' bug.
This commit is contained in:
parent
89b5b53193
commit
b94e761d73
@ -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;
|
||||
}
|
||||
|
11
src/osal.h
11
src/osal.h
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user