From b3a9b3ca1a47b0f8f4553fce62a2f7861f17ee0d Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 27 Aug 2019 00:29:15 +0300 Subject: [PATCH] mdbx: avoid refs to mdbx_runtime_flags from tools. --- src/bits.h | 2 ++ src/tools/mdbx_chk.c | 2 ++ src/tools/mdbx_copy.c | 2 ++ src/tools/mdbx_dump.c | 3 +++ src/tools/mdbx_load.c | 3 +++ src/tools/mdbx_stat.c | 2 ++ 6 files changed, 14 insertions(+) diff --git a/src/bits.h b/src/bits.h index 8657ae47..fd36cac9 100644 --- a/src/bits.h +++ b/src/bits.h @@ -864,7 +864,9 @@ typedef struct MDBX_ntxn { /*----------------------------------------------------------------------------*/ /* Debug and Logging stuff */ +#ifndef mdbx_runtime_flags /* avoid override from tools */ extern int mdbx_runtime_flags; +#endif extern MDBX_debug_func *mdbx_debug_logger; extern txnid_t mdbx_debug_edge; diff --git a/src/tools/mdbx_chk.c b/src/tools/mdbx_chk.c index 9ece913d..9d3b9e06 100644 --- a/src/tools/mdbx_chk.c +++ b/src/tools/mdbx_chk.c @@ -20,6 +20,8 @@ #pragma warning(disable : 4996) /* The POSIX name is deprecated... */ #endif /* _MSC_VER (warnings) */ +/* Avoid reference to mdbx_runtime_flags from assert() */ +#define mdbx_runtime_flags (~0u) #include "../bits.h" typedef struct flagbit { diff --git a/src/tools/mdbx_copy.c b/src/tools/mdbx_copy.c index 9b0c833a..f700b178 100644 --- a/src/tools/mdbx_copy.c +++ b/src/tools/mdbx_copy.c @@ -20,6 +20,8 @@ #pragma warning(disable : 4996) /* The POSIX name is deprecated... */ #endif /* _MSC_VER (warnings) */ +/* Avoid reference to mdbx_runtime_flags from assert() */ +#define mdbx_runtime_flags (~0u) #include "../bits.h" #if defined(_WIN32) || defined(_WIN64) diff --git a/src/tools/mdbx_dump.c b/src/tools/mdbx_dump.c index 07951548..8cb9c86e 100644 --- a/src/tools/mdbx_dump.c +++ b/src/tools/mdbx_dump.c @@ -20,7 +20,10 @@ #pragma warning(disable : 4996) /* The POSIX name is deprecated... */ #endif /* _MSC_VER (warnings) */ +/* Avoid reference to mdbx_runtime_flags from assert() */ +#define mdbx_runtime_flags (~0u) #include "../bits.h" + #include #define PRINT 1 diff --git a/src/tools/mdbx_load.c b/src/tools/mdbx_load.c index 9789e83a..9c679acb 100644 --- a/src/tools/mdbx_load.c +++ b/src/tools/mdbx_load.c @@ -20,7 +20,10 @@ #pragma warning(disable : 4996) /* The POSIX name is deprecated... */ #endif /* _MSC_VER (warnings) */ +/* Avoid reference to mdbx_runtime_flags from assert() */ +#define mdbx_runtime_flags (~0u) #include "../bits.h" + #include #if defined(_WIN32) || defined(_WIN64) diff --git a/src/tools/mdbx_stat.c b/src/tools/mdbx_stat.c index e459121d..d4ebc2e6 100644 --- a/src/tools/mdbx_stat.c +++ b/src/tools/mdbx_stat.c @@ -20,6 +20,8 @@ #pragma warning(disable : 4996) /* The POSIX name is deprecated... */ #endif /* _MSC_VER (warnings) */ +/* Avoid reference to mdbx_runtime_flags from assert() */ +#define mdbx_runtime_flags (~0u) #include "../bits.h" #if defined(_WIN32) || defined(_WIN64)