mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 05:28:21 +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 */
|
#endif /* __must_check_result */
|
||||||
|
|
||||||
#if !defined(__noop) && !defined(_MSC_VER)
|
#if !defined(__noop) && !defined(_MSC_VER)
|
||||||
# define __noop(...) do {} while(0)
|
# define __noop do {} while(0)
|
||||||
#endif /* __noop */
|
#endif /* __noop */
|
||||||
|
|
||||||
#if defined(__fallthrough) && \
|
#if defined(__fallthrough) && \
|
||||||
@ -136,7 +136,7 @@
|
|||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __unreachable() __assume(0)
|
# define __unreachable() __assume(0)
|
||||||
# else
|
# else
|
||||||
# define __unreachable() __noop()
|
# define __unreachable() do {} while(1)
|
||||||
# endif
|
# endif
|
||||||
#endif /* __unreachable */
|
#endif /* __unreachable */
|
||||||
|
|
||||||
@ -144,7 +144,7 @@
|
|||||||
# if defined(__GNUC__) || defined(__clang__) || __has_builtin(__builtin_prefetch)
|
# if defined(__GNUC__) || defined(__clang__) || __has_builtin(__builtin_prefetch)
|
||||||
# define __prefetch(ptr) __builtin_prefetch(ptr)
|
# define __prefetch(ptr) __builtin_prefetch(ptr)
|
||||||
# else
|
# else
|
||||||
# define __prefetch(ptr) __noop(ptr)
|
# define __prefetch(ptr) do { (void)(ptr); } while(0)
|
||||||
# endif
|
# endif
|
||||||
#endif /* __prefetch */
|
#endif /* __prefetch */
|
||||||
|
|
||||||
|
@ -85,6 +85,9 @@ public:
|
|||||||
|
|
||||||
} // namespace logging
|
} // 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_extra(const char *msg, ...);
|
||||||
void MDBX_PRINTF_ARGS(1, 2) log_trace(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, ...);
|
void MDBX_PRINTF_ARGS(1, 2) log_debug(const char *msg, ...);
|
||||||
@ -100,5 +103,5 @@ bool log_enabled(const logging::loglevel priority);
|
|||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define TRACE(...) log_trace(__VA_ARGS__)
|
#define TRACE(...) log_trace(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define TRACE(...) __noop(__VA_ARGS__)
|
#define TRACE(...) log_null(__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user