mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-01 22:44:13 +08:00
mdbx: refine attribute-based macros.
This commit is contained in:
parent
7780b76cf0
commit
137d652d77
4
mdbx.h
4
mdbx.h
@ -148,8 +148,8 @@ typedef pthread_t mdbx_tid_t;
|
|||||||
#else
|
#else
|
||||||
#define __dll_export
|
#define __dll_export
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__GNUC__) || __has_attribute(visibility)
|
#elif defined(__GNUC__) || __has_attribute(__visibility__)
|
||||||
#define __dll_export __attribute__((visibility("default")))
|
#define __dll_export __attribute__((__visibility__("default")))
|
||||||
#else
|
#else
|
||||||
#define __dll_export
|
#define __dll_export
|
||||||
#endif
|
#endif
|
||||||
|
12
src/bits.h
12
src/bits.h
@ -863,17 +863,9 @@ extern MDBX_debug_func *mdbx_debug_logger;
|
|||||||
extern txnid_t mdbx_debug_edge;
|
extern txnid_t mdbx_debug_edge;
|
||||||
|
|
||||||
void mdbx_debug_log(int type, const char *function, int line, const char *fmt,
|
void mdbx_debug_log(int type, const char *function, int line, const char *fmt,
|
||||||
...)
|
...) __printf_args(4, 5);
|
||||||
#if defined(__GNUC__) || __has_attribute(format)
|
|
||||||
__attribute__((format(printf, 4, 5)))
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
void mdbx_panic(const char *fmt, ...)
|
void mdbx_panic(const char *fmt, ...) __printf_args(1, 2);
|
||||||
#if defined(__GNUC__) || __has_attribute(format)
|
|
||||||
__attribute__((format(printf, 1, 2)))
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
#if MDBX_DEBUG
|
#if MDBX_DEBUG
|
||||||
|
|
||||||
|
86
src/defs.h
86
src/defs.h
@ -104,8 +104,8 @@
|
|||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef __always_inline
|
#ifndef __always_inline
|
||||||
# if defined(__GNUC__) || __has_attribute(always_inline)
|
# if defined(__GNUC__) || __has_attribute(__always_inline__)
|
||||||
# define __always_inline __inline __attribute__((always_inline))
|
# define __always_inline __inline __attribute__((__always_inline__))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __always_inline __forceinline
|
# define __always_inline __forceinline
|
||||||
# else
|
# else
|
||||||
@ -114,8 +114,8 @@
|
|||||||
#endif /* __always_inline */
|
#endif /* __always_inline */
|
||||||
|
|
||||||
#ifndef __noinline
|
#ifndef __noinline
|
||||||
# if defined(__GNUC__) || __has_attribute(noinline)
|
# if defined(__GNUC__) || __has_attribute(__noinline__)
|
||||||
# define __noinline __attribute__((noinline))
|
# define __noinline __attribute__((__noinline__))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __noinline __declspec(noinline)
|
# define __noinline __declspec(noinline)
|
||||||
# elif defined(__SUNPRO_C) || defined(__sun) || defined(sun)
|
# elif defined(__SUNPRO_C) || defined(__sun) || defined(sun)
|
||||||
@ -126,16 +126,16 @@
|
|||||||
#endif /* __noinline */
|
#endif /* __noinline */
|
||||||
|
|
||||||
#ifndef __must_check_result
|
#ifndef __must_check_result
|
||||||
# if defined(__GNUC__) || __has_attribute(warn_unused_result)
|
# if defined(__GNUC__) || __has_attribute(__warn_unused_result__)
|
||||||
# define __must_check_result __attribute__((warn_unused_result))
|
# define __must_check_result __attribute__((__warn_unused_result__))
|
||||||
# else
|
# else
|
||||||
# define __must_check_result
|
# define __must_check_result
|
||||||
# endif
|
# endif
|
||||||
#endif /* __must_check_result */
|
#endif /* __must_check_result */
|
||||||
|
|
||||||
#ifndef __deprecated
|
#ifndef __deprecated
|
||||||
# if defined(__GNUC__) || __has_attribute(deprecated)
|
# if defined(__GNUC__) || __has_attribute(__deprecated__)
|
||||||
# define __deprecated __attribute__((deprecated))
|
# define __deprecated __attribute__((__deprecated__))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __deprecated __declspec(deprecated)
|
# define __deprecated __declspec(deprecated)
|
||||||
# else
|
# else
|
||||||
@ -163,8 +163,8 @@
|
|||||||
#endif /* __noop */
|
#endif /* __noop */
|
||||||
|
|
||||||
#ifndef __fallthrough
|
#ifndef __fallthrough
|
||||||
# if __GNUC_PREREQ(7, 0) || __has_attribute(fallthrough)
|
# if __GNUC_PREREQ(7, 0) || __has_attribute(__fallthrough__)
|
||||||
# define __fallthrough __attribute__((fallthrough))
|
# define __fallthrough __attribute__((__fallthrough__))
|
||||||
# else
|
# else
|
||||||
# define __fallthrough __noop()
|
# define __fallthrough __noop()
|
||||||
# endif
|
# endif
|
||||||
@ -189,8 +189,8 @@
|
|||||||
#endif /* __prefetch */
|
#endif /* __prefetch */
|
||||||
|
|
||||||
#ifndef __noreturn
|
#ifndef __noreturn
|
||||||
# if defined(__GNUC__) || __has_attribute(noreturn)
|
# if defined(__GNUC__) || __has_attribute(__noreturn__)
|
||||||
# define __noreturn __attribute__((noreturn))
|
# define __noreturn __attribute__((__noreturn__))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __noreturn __declspec(noreturn)
|
# define __noreturn __declspec(noreturn)
|
||||||
# else
|
# else
|
||||||
@ -199,8 +199,14 @@
|
|||||||
#endif /* __noreturn */
|
#endif /* __noreturn */
|
||||||
|
|
||||||
#ifndef __nothrow
|
#ifndef __nothrow
|
||||||
# if defined(__GNUC__) || __has_attribute(nothrow)
|
# if defined(__cplusplus)
|
||||||
# define __nothrow __attribute__((nothrow))
|
# if __cplusplus < 201703L
|
||||||
|
# define __nothrow throw()
|
||||||
|
# else
|
||||||
|
# define __nothrow noexcept(true)
|
||||||
|
# endif /* __cplusplus */
|
||||||
|
# elif defined(__GNUC__) || __has_attribute(__nothrow__)
|
||||||
|
# define __nothrow __attribute__((__nothrow__))
|
||||||
# elif defined(_MSC_VER) && defined(__cplusplus)
|
# elif defined(_MSC_VER) && defined(__cplusplus)
|
||||||
# define __nothrow __declspec(nothrow)
|
# define __nothrow __declspec(nothrow)
|
||||||
# else
|
# else
|
||||||
@ -214,8 +220,8 @@
|
|||||||
* Such a function can be subject to common subexpression elimination
|
* Such a function can be subject to common subexpression elimination
|
||||||
* and loop optimization just as an arithmetic operator would be.
|
* and loop optimization just as an arithmetic operator would be.
|
||||||
* These functions should be declared with the attribute pure. */
|
* These functions should be declared with the attribute pure. */
|
||||||
# if defined(__GNUC__) || __has_attribute(pure)
|
# if defined(__GNUC__) || __has_attribute(__pure__)
|
||||||
# define __pure_function __attribute__((pure))
|
# define __pure_function __attribute__((__pure__))
|
||||||
# else
|
# else
|
||||||
# define __pure_function
|
# define __pure_function
|
||||||
# endif
|
# endif
|
||||||
@ -231,27 +237,27 @@
|
|||||||
* data pointed to must not be declared const. Likewise, a function
|
* data pointed to must not be declared const. Likewise, a function
|
||||||
* that calls a non-const function usually must not be const.
|
* that calls a non-const function usually must not be const.
|
||||||
* It does not make sense for a const function to return void. */
|
* It does not make sense for a const function to return void. */
|
||||||
# if defined(__GNUC__) || __has_attribute(const)
|
# if defined(__GNUC__) || __has_attribute(__const__)
|
||||||
# define __const_function __attribute__((const))
|
# define __const_function __attribute__((__const__))
|
||||||
# else
|
# else
|
||||||
# define __const_function
|
# define __const_function
|
||||||
# endif
|
# endif
|
||||||
#endif /* __const_function */
|
#endif /* __const_function */
|
||||||
|
|
||||||
#ifndef __dll_hidden
|
#ifndef __hidden
|
||||||
# if defined(__GNUC__) || __has_attribute(visibility)
|
# if defined(__GNUC__) || __has_attribute(__visibility__)
|
||||||
# define __dll_hidden __attribute__((visibility("hidden")))
|
# define __hidden __attribute__((__visibility__("hidden")))
|
||||||
# else
|
# else
|
||||||
# define __dll_hidden
|
# define __hidden
|
||||||
# endif
|
# endif
|
||||||
#endif /* __dll_hidden */
|
#endif /* __hidden */
|
||||||
|
|
||||||
#ifndef __optimize
|
#ifndef __optimize
|
||||||
# if defined(__OPTIMIZE__)
|
# if defined(__OPTIMIZE__)
|
||||||
# if defined(__clang__) && !__has_attribute(optimize)
|
# if defined(__clang__) && !__has_attribute(__optimize__)
|
||||||
# define __optimize(ops)
|
# define __optimize(ops)
|
||||||
# elif defined(__GNUC__) || __has_attribute(optimize)
|
# elif defined(__GNUC__) || __has_attribute(__optimize__)
|
||||||
# define __optimize(ops) __attribute__((optimize(ops)))
|
# define __optimize(ops) __attribute__((__optimize__(ops)))
|
||||||
# else
|
# else
|
||||||
# define __optimize(ops)
|
# define __optimize(ops)
|
||||||
# endif
|
# endif
|
||||||
@ -263,12 +269,13 @@
|
|||||||
#ifndef __hot
|
#ifndef __hot
|
||||||
# if defined(__OPTIMIZE__)
|
# if defined(__OPTIMIZE__)
|
||||||
# if defined(__e2k__)
|
# if defined(__e2k__)
|
||||||
# define __hot __attribute__((hot)) __optimize(3)
|
# define __hot __attribute__((__hot__)) __optimize(3)
|
||||||
# elif defined(__clang__) && !__has_attribute(hot)
|
# elif defined(__clang__) && !__has_attribute(__hot_) \
|
||||||
|
&& __has_attribute(__section__) && (defined(__linux__) || defined(__gnu_linux__))
|
||||||
/* just put frequently used functions in separate section */
|
/* just put frequently used functions in separate section */
|
||||||
# define __hot __attribute__((section("text.hot"))) __optimize("O3")
|
# define __hot __attribute__((__section__("text.hot"))) __optimize("O3")
|
||||||
# elif defined(__GNUC__) || __has_attribute(hot)
|
# elif defined(__GNUC__) || __has_attribute(__hot__)
|
||||||
# define __hot __attribute__((hot)) __optimize("O3")
|
# define __hot __attribute__((__hot__)) __optimize("O3")
|
||||||
# else
|
# else
|
||||||
# define __hot __optimize("O3")
|
# define __hot __optimize("O3")
|
||||||
# endif
|
# endif
|
||||||
@ -280,12 +287,13 @@
|
|||||||
#ifndef __cold
|
#ifndef __cold
|
||||||
# if defined(__OPTIMIZE__)
|
# if defined(__OPTIMIZE__)
|
||||||
# if defined(__e2k__)
|
# if defined(__e2k__)
|
||||||
# define __cold __attribute__((cold)) __optimize(1)
|
# define __cold __attribute__((__cold__)) __optimize(1)
|
||||||
# elif defined(__clang__) && !__has_attribute(cold)
|
# elif defined(__clang__) && !__has_attribute(cold) \
|
||||||
|
&& __has_attribute(__section__) && (defined(__linux__) || defined(__gnu_linux__))
|
||||||
/* just put infrequently used functions in separate section */
|
/* just put infrequently used functions in separate section */
|
||||||
# define __cold __attribute__((section("text.unlikely"))) __optimize("Os")
|
# define __cold __attribute__((__section__("text.unlikely"))) __optimize("Os")
|
||||||
# elif defined(__GNUC__) || __has_attribute(cold)
|
# elif defined(__GNUC__) || __has_attribute(cold)
|
||||||
# define __cold __attribute__((cold)) __optimize("Os")
|
# define __cold __attribute__((__cold__)) __optimize("Os")
|
||||||
# else
|
# else
|
||||||
# define __cold __optimize("Os")
|
# define __cold __optimize("Os")
|
||||||
# endif
|
# endif
|
||||||
@ -295,8 +303,8 @@
|
|||||||
#endif /* __cold */
|
#endif /* __cold */
|
||||||
|
|
||||||
#ifndef __flatten
|
#ifndef __flatten
|
||||||
# if defined(__OPTIMIZE__) && (defined(__GNUC__) || __has_attribute(flatten))
|
# if defined(__OPTIMIZE__) && (defined(__GNUC__) || __has_attribute(__flatten__))
|
||||||
# define __flatten __attribute__((flatten))
|
# define __flatten __attribute__((__flatten__))
|
||||||
# else
|
# else
|
||||||
# define __flatten
|
# define __flatten
|
||||||
# endif
|
# endif
|
||||||
@ -338,9 +346,9 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
|
|||||||
# define mdbx_func_ "<mdbx_unknown>"
|
# define mdbx_func_ "<mdbx_unknown>"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) || __has_attribute(format)
|
#if defined(__GNUC__) || __has_attribute(__format__)
|
||||||
#define __printf_args(format_index, first_arg) \
|
#define __printf_args(format_index, first_arg) \
|
||||||
__attribute__((format(printf, format_index, first_arg)))
|
__attribute__((__format__(printf, format_index, first_arg)))
|
||||||
#else
|
#else
|
||||||
#define __printf_args(format_index, first_arg)
|
#define __printf_args(format_index, first_arg)
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,7 +41,8 @@
|
|||||||
/* global constructor/destructor */
|
/* global constructor/destructor */
|
||||||
|
|
||||||
uint32_t mdbx_linux_kernel_version;
|
uint32_t mdbx_linux_kernel_version;
|
||||||
static __cold __attribute__((constructor)) void mdbx_global_constructor(void) {
|
static __cold __attribute__((__constructor__)) void
|
||||||
|
mdbx_global_constructor(void) {
|
||||||
struct utsname buffer;
|
struct utsname buffer;
|
||||||
if (uname(&buffer) == 0) {
|
if (uname(&buffer) == 0) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -64,7 +65,8 @@ static __cold __attribute__((constructor)) void mdbx_global_constructor(void) {
|
|||||||
mdbx_rthc_global_init();
|
mdbx_rthc_global_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __cold __attribute__((destructor)) void mdbx_global_destructor(void) {
|
static __cold __attribute__((__destructor__)) void
|
||||||
|
mdbx_global_destructor(void) {
|
||||||
mdbx_rthc_global_dtor();
|
mdbx_rthc_global_dtor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,13 @@
|
|||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
/* rthc */
|
/* rthc */
|
||||||
|
|
||||||
static __cold __attribute__((constructor)) void mdbx_global_constructor(void) {
|
static __cold __attribute__((__constructor__)) void
|
||||||
|
mdbx_global_constructor(void) {
|
||||||
mdbx_rthc_global_init();
|
mdbx_rthc_global_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static __cold __attribute__((destructor)) void mdbx_global_destructor(void) {
|
static __cold __attribute__((__destructor__)) void
|
||||||
|
mdbx_global_destructor(void) {
|
||||||
mdbx_rthc_global_dtor();
|
mdbx_rthc_global_dtor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ static
|
|||||||
# ifdef _WIN64
|
# ifdef _WIN64
|
||||||
const
|
const
|
||||||
# endif
|
# endif
|
||||||
PIMAGE_TLS_CALLBACK mdbx_tls_anchor __attribute__((section(".CRT$XLB"), used)) = mdbx_dll_callback;
|
PIMAGE_TLS_CALLBACK mdbx_tls_anchor __attribute__((__section__(".CRT$XLB"), used)) = mdbx_dll_callback;
|
||||||
#else
|
#else
|
||||||
# error FIXME
|
# error FIXME
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,7 +291,7 @@ typedef struct rthc_entry_t {
|
|||||||
static CRITICAL_SECTION rthc_critical_section;
|
static CRITICAL_SECTION rthc_critical_section;
|
||||||
#else
|
#else
|
||||||
int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj, void *dso_symbol)
|
int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj, void *dso_symbol)
|
||||||
__attribute__((weak));
|
__attribute__((__weak__));
|
||||||
#ifdef __APPLE__ /* FIXME: Thread-Local Storage destructors & DSO-unloading */
|
#ifdef __APPLE__ /* FIXME: Thread-Local Storage destructors & DSO-unloading */
|
||||||
int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
|
int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
|
||||||
void *dso_symbol) {
|
void *dso_symbol) {
|
||||||
@ -13095,7 +13095,7 @@ MDBX_oom_func *__cold mdbx_env_get_oomfunc(MDBX_env *env) {
|
|||||||
|
|
||||||
#ifdef __SANITIZE_THREAD__
|
#ifdef __SANITIZE_THREAD__
|
||||||
/* LY: avoid tsan-trap by me_txn, mm_last_pg and mt_next_pgno */
|
/* LY: avoid tsan-trap by me_txn, mm_last_pg and mt_next_pgno */
|
||||||
__attribute__((no_sanitize_thread, noinline))
|
__attribute__((__no_sanitize_thread__, __noinline__))
|
||||||
#endif
|
#endif
|
||||||
int mdbx_txn_straggler(MDBX_txn *txn, int *percent)
|
int mdbx_txn_straggler(MDBX_txn *txn, int *percent)
|
||||||
{
|
{
|
||||||
@ -14403,7 +14403,7 @@ int mdbx_set_attr(MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data,
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __SANITIZE_ADDRESS__
|
#ifdef __SANITIZE_ADDRESS__
|
||||||
LIBMDBX_API __attribute__((weak)) const char *__asan_default_options() {
|
LIBMDBX_API __attribute__((__weak__)) const char *__asan_default_options() {
|
||||||
return "symbolize=1:allow_addr2line=1:"
|
return "symbolize=1:allow_addr2line=1:"
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
"debug=1:"
|
"debug=1:"
|
||||||
|
38
src/osal.c
38
src/osal.c
@ -157,18 +157,44 @@ typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
|
|||||||
/* workaround for avoid musl libc wrong prototype */ ( \
|
/* workaround for avoid musl libc wrong prototype */ ( \
|
||||||
defined(__GLIBC__) || defined(__GNU_LIBRARY__))
|
defined(__GLIBC__) || defined(__GNU_LIBRARY__))
|
||||||
/* Prototype should match libc runtime. ISO POSIX (2003) & LSB 1.x-3.x */
|
/* Prototype should match libc runtime. ISO POSIX (2003) & LSB 1.x-3.x */
|
||||||
__nothrow __noreturn void __assert_fail(const char *assertion, const char *file,
|
__extern_C void __assert_fail(const char *assertion, const char *file,
|
||||||
unsigned line, const char *function);
|
unsigned line, const char *function)
|
||||||
|
#ifdef __THROW
|
||||||
|
__THROW
|
||||||
|
#else
|
||||||
|
__nothrow
|
||||||
|
#endif /* __THROW */
|
||||||
|
__noreturn;
|
||||||
|
|
||||||
#elif defined(__APPLE__) || defined(__MACH__)
|
#elif defined(__APPLE__) || defined(__MACH__)
|
||||||
__nothrow __noreturn void __assert_rtn(const char *function, const char *file,
|
__extern_C void __assert_rtn(const char *function, const char *file, int line,
|
||||||
int line, const char *assertion);
|
const char *assertion) /* __nothrow */
|
||||||
|
#ifdef __dead2
|
||||||
|
__dead2
|
||||||
|
#else
|
||||||
|
__noreturn
|
||||||
|
#endif /* __dead2 */
|
||||||
|
#ifdef __disable_tail_calls
|
||||||
|
__disable_tail_calls
|
||||||
|
#endif /* __disable_tail_calls */
|
||||||
|
;
|
||||||
|
|
||||||
#define __assert_fail(assertion, file, line, function) \
|
#define __assert_fail(assertion, file, line, function) \
|
||||||
__assert_rtn(function, file, line, assertion)
|
__assert_rtn(function, file, line, assertion)
|
||||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
|
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
|
||||||
defined(__BSD__) || defined(__NETBSD__) || defined(__bsdi__) || \
|
defined(__BSD__) || defined(__NETBSD__) || defined(__bsdi__) || \
|
||||||
defined(__DragonFly__)
|
defined(__DragonFly__)
|
||||||
__nothrow __noreturn void __assert(const char *function, const char *file,
|
__extern_C void __assert(const char *function, const char *file, int line,
|
||||||
int line, const char *assertion);
|
const char *assertion) /* __nothrow */
|
||||||
|
#ifdef __dead2
|
||||||
|
__dead2
|
||||||
|
#else
|
||||||
|
__noreturn
|
||||||
|
#endif /* __dead2 */
|
||||||
|
#ifdef __disable_tail_calls
|
||||||
|
__disable_tail_calls
|
||||||
|
#endif /* __disable_tail_calls */
|
||||||
|
;
|
||||||
#define __assert_fail(assertion, file, line, function) \
|
#define __assert_fail(assertion, file, line, function) \
|
||||||
__assert(function, file, line, assertion)
|
__assert(function, file, line, assertion)
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
#define alignas(N) _Alignas(N)
|
#define alignas(N) _Alignas(N)
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
#define alignas(N) __declspec(align(N))
|
#define alignas(N) __declspec(align(N))
|
||||||
#elif __has_attribute(aligned) || defined(__GNUC__)
|
#elif __has_attribute(__aligned__) || defined(__GNUC__)
|
||||||
#define alignas(N) __attribute__((aligned(N)))
|
#define alignas(N) __attribute__((__aligned__(N)))
|
||||||
#else
|
#else
|
||||||
#error "FIXME: Required _alignas() or equivalent."
|
#error "FIXME: Required _alignas() or equivalent."
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,11 +105,7 @@ struct problem {
|
|||||||
struct problem *problems_list;
|
struct problem *problems_list;
|
||||||
uint64_t total_problems;
|
uint64_t total_problems;
|
||||||
|
|
||||||
static void
|
static void __printf_args(1, 2) print(const char *msg, ...) {
|
||||||
#ifdef __GNUC__
|
|
||||||
__attribute__((format(printf, 1, 2)))
|
|
||||||
#endif
|
|
||||||
print(const char *msg, ...) {
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -120,11 +116,7 @@ static void
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void __printf_args(1, 2) error(const char *msg, ...) {
|
||||||
#ifdef __GNUC__
|
|
||||||
__attribute__((format(printf, 1, 2)))
|
|
||||||
#endif
|
|
||||||
error(const char *msg, ...) {
|
|
||||||
total_problems++;
|
total_problems++;
|
||||||
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
@ -181,10 +173,8 @@ static walk_dbi_t *pagemap_lookup_dbi(const char *dbi_name, bool silent) {
|
|||||||
return last = dbi;
|
return last = dbi;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void __printf_args(4, 5)
|
||||||
#ifdef __GNUC__
|
|
||||||
__attribute__((format(printf, 4, 5)))
|
|
||||||
#endif
|
|
||||||
problem_add(const char *object, uint64_t entry_number, const char *msg,
|
problem_add(const char *object, uint64_t entry_number, const char *msg,
|
||||||
const char *extra, ...) {
|
const char *extra, ...) {
|
||||||
total_problems++;
|
total_problems++;
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
||||||
#define __unused __attribute__((unused))
|
|
||||||
|
|
||||||
int pthread_barrierattr_init(pthread_barrierattr_t *attr) {
|
int pthread_barrierattr_init(pthread_barrierattr_t *attr) {
|
||||||
memset(attr, 0, sizeof(pthread_barrierattr_t));
|
memset(attr, 0, sizeof(pthread_barrierattr_t));
|
||||||
int m = pthread_mutexattr_init(&attr->mattr);
|
int m = pthread_mutexattr_init(&attr->mattr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user