From 1f89c494ffe6569352e43eec8867bfeb182dfb8a Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 7 Jul 2019 19:32:39 +0300 Subject: [PATCH] mdbx: refines OFF_T_MAX if it is not defined. Change-Id: Ic453140e01725493cad0c98e73244c747d5f490e --- src/lck-posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lck-posix.c b/src/lck-posix.c index e8d4539a..ccfced30 100644 --- a/src/lck-posix.c +++ b/src/lck-posix.c @@ -44,7 +44,8 @@ static __cold __attribute__((destructor)) void mdbx_global_destructor(void) { /* lck */ #ifndef OFF_T_MAX -#define OFF_T_MAX (sizeof(off_t) > 4 ? INT64_MAX : INT32_MAX) +#define OFF_T_MAX \ + ((sizeof(off_t) > 4 ? INT64_MAX : INT32_MAX) & ~(size_t)0xffff) #endif #define LCK_WHOLE OFF_T_MAX