mdbx: fix build with uclibc.

Change-Id: I907fecd84b335a84d5f1dcaa44ac489c4dfb1907
This commit is contained in:
Leonid Yuriev 2020-09-27 12:50:13 +03:00
parent 12770cae88
commit 1e3f633665
3 changed files with 16 additions and 4 deletions

View File

@ -1623,6 +1623,7 @@ typename
ubsan ubsan
ubuntu ubuntu
ucf ucf
UCLIBC
UCRT UCRT
udelay udelay
ue ue

View File

@ -165,7 +165,7 @@
/** Advanced: Using sendfile() syscall (autodetection by default). */ /** Advanced: Using sendfile() syscall (autodetection by default). */
#ifndef MDBX_USE_SENDFILE #ifndef MDBX_USE_SENDFILE
#if ((defined(__linux__) || defined(__gnu_linux__)) && \ #if ((defined(__linux__) || defined(__gnu_linux__)) && \
__GLIBC_PREREQ(2, 3)) || \ !defined(__ANDROID_API__)) || \
(defined(__ANDROID_API__) && __ANDROID_API__ >= 21) (defined(__ANDROID_API__) && __ANDROID_API__ >= 21)
#define MDBX_USE_SENDFILE 1 #define MDBX_USE_SENDFILE 1
#else #else
@ -184,8 +184,8 @@
/** Advanced: Using sync_file_range() syscall (autodetection by default). */ /** Advanced: Using sync_file_range() syscall (autodetection by default). */
#ifndef MDBX_USE_SYNCFILERANGE #ifndef MDBX_USE_SYNCFILERANGE
#if ((defined(__linux__) || defined(__gnu_linux__)) && __GLIBC_PREREQ(2, 6) && \ #if ((defined(__linux__) || defined(__gnu_linux__)) && \
defined(_GNU_SOURCE)) || \ defined(SYNC_FILE_RANGE_WRITE) && !defined(__ANDROID_API__)) || \
(defined(__ANDROID_API__) && __ANDROID_API__ >= 26) (defined(__ANDROID_API__) && __ANDROID_API__ >= 26)
#define MDBX_USE_SYNCFILERANGE 1 #define MDBX_USE_SYNCFILERANGE 1
#else #else

View File

@ -134,7 +134,18 @@ typedef struct _FILE_PROVIDER_EXTERNAL_INFO_V1 {
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#if _POSIX_C_SOURCE > 200212 && \ #if defined(__UCLIBC__)
__extern_C void __assert(const char *, const char *, unsigned int, const char *)
#ifdef __THROW
__THROW
#else
__nothrow
#endif /* __THROW */
__noreturn;
#define __assert_fail(assertion, file, line, function) \
__assert(assertion, file, line, function)
#elif _POSIX_C_SOURCE > 200212 && \
/* 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 */