From 070ba5ded47f1375d0f9a87f27a08751a4c6d698 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 4 Jan 2022 13:41:25 +0300 Subject: [PATCH] mdbx: check for GCC/clang in debug-includes (insignificant internals). --- src/debug_begin.h | 6 ++++++ src/debug_end.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/debug_begin.h b/src/debug_begin.h index b2b2d0bb..9a904095 100644 --- a/src/debug_begin.h +++ b/src/debug_begin.h @@ -1,3 +1,5 @@ +#if defined(__GNUC__) && !defined(__LCC__) + #pragma push_macro("mdbx_trace") #pragma push_macro("mdbx_debug") #pragma push_macro("mdbx_verbose") @@ -33,4 +35,8 @@ #undef mdbx_assert #define mdbx_assert(env, expr) mdbx_ensure(env, expr) +#if !defined(__clang__) #pragma GCC optimize("-O0") +#endif + +#endif /* GCC only */ diff --git a/src/debug_end.h b/src/debug_end.h index 3d840e68..a854f715 100644 --- a/src/debug_end.h +++ b/src/debug_end.h @@ -1,3 +1,5 @@ +#if defined(__GNUC__) && !defined(__LCC__) + #pragma pop_macro("mdbx_trace") #pragma pop_macro("mdbx_debug") #pragma pop_macro("mdbx_verbose") @@ -6,4 +8,8 @@ #pragma pop_macro("mdbx_error") #pragma pop_macro("mdbx_assert") +#if !defined(__clang__) #pragma GCC reset_options +#endif + +#endif /* GCC only */