mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:34:13 +08:00
mdbx: made internal noop
macro compatible with MSVC.
This commit is contained in:
parent
106f39327e
commit
535ad41ae6
@ -104,7 +104,7 @@
|
||||
#endif /* __must_check_result */
|
||||
|
||||
#if !defined(__noop) && !defined(_MSC_VER)
|
||||
# define __noop(...) do {} while(0)
|
||||
# define __noop do {} while(0)
|
||||
#endif /* __noop */
|
||||
|
||||
#if defined(__fallthrough) && \
|
||||
@ -136,7 +136,7 @@
|
||||
# elif defined(_MSC_VER)
|
||||
# define __unreachable() __assume(0)
|
||||
# else
|
||||
# define __unreachable() __noop()
|
||||
# define __unreachable() do {} while(1)
|
||||
# endif
|
||||
#endif /* __unreachable */
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
# if defined(__GNUC__) || defined(__clang__) || __has_builtin(__builtin_prefetch)
|
||||
# define __prefetch(ptr) __builtin_prefetch(ptr)
|
||||
# else
|
||||
# define __prefetch(ptr) __noop(ptr)
|
||||
# define __prefetch(ptr) do { (void)(ptr); } while(0)
|
||||
# endif
|
||||
#endif /* __prefetch */
|
||||
|
||||
|
@ -85,6 +85,9 @@ public:
|
||||
|
||||
} // namespace logging
|
||||
|
||||
void MDBX_PRINTF_ARGS(1, 2) static inline log_null(const char *msg, ...) {
|
||||
return (void)msg;
|
||||
}
|
||||
void MDBX_PRINTF_ARGS(1, 2) log_extra(const char *msg, ...);
|
||||
void MDBX_PRINTF_ARGS(1, 2) log_trace(const char *msg, ...);
|
||||
void MDBX_PRINTF_ARGS(1, 2) log_debug(const char *msg, ...);
|
||||
@ -100,5 +103,5 @@ bool log_enabled(const logging::loglevel priority);
|
||||
#ifdef _DEBUG
|
||||
#define TRACE(...) log_trace(__VA_ARGS__)
|
||||
#else
|
||||
#define TRACE(...) __noop(__VA_ARGS__)
|
||||
#define TRACE(...) log_null(__VA_ARGS__)
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user