mdbx: refine attribute-based macros.

This commit is contained in:
Leonid Yuriev
2019-08-25 03:05:58 +03:00
parent 7780b76cf0
commit 137d652d77
11 changed files with 101 additions and 83 deletions

View File

@@ -157,18 +157,44 @@ typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
/* workaround for avoid musl libc wrong prototype */ ( \
defined(__GLIBC__) || defined(__GNU_LIBRARY__))
/* Prototype should match libc runtime. ISO POSIX (2003) & LSB 1.x-3.x */
__nothrow __noreturn void __assert_fail(const char *assertion, const char *file,
unsigned line, const char *function);
__extern_C void __assert_fail(const char *assertion, const char *file,
unsigned line, const char *function)
#ifdef __THROW
__THROW
#else
__nothrow
#endif /* __THROW */
__noreturn;
#elif defined(__APPLE__) || defined(__MACH__)
__nothrow __noreturn void __assert_rtn(const char *function, const char *file,
int line, const char *assertion);
__extern_C void __assert_rtn(const char *function, const char *file, int line,
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) \
__assert_rtn(function, file, line, assertion)
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__BSD__) || defined(__NETBSD__) || defined(__bsdi__) || \
defined(__DragonFly__)
__nothrow __noreturn void __assert(const char *function, const char *file,
int line, const char *assertion);
__extern_C void __assert(const char *function, const char *file, int line,
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) \
__assert(function, file, line, assertion)