Fix compilation on musl (#8067)

This commit is contained in:
Bart Ribbers authored and Michał Janiszewski committed 2018-10-09 20:42:02 +02:00
1 parent 1e9cda8d2b
commit 8e6eb08275
2 files changed
+4 -11

No files matched your search

+2 -4
View File
@@ -79,11 +79,9 @@ using colour_t = uint8_t;
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#if !( \
(defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700) \
|| (defined(__APPLE__) && defined(__MACH__)) || defined(__ANDROID_API__) || defined(__FreeBSD__))
#ifdef _WIN32
char* strndup(const char* src, size_t size);
#endif // !(POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
#endif
// BSD and macOS have MAP_ANON instead of MAP_ANONYMOUS
#ifndef MAP_ANONYMOUS
+2 -7
View File
@@ -43,9 +43,7 @@
static mach_timebase_info_data_t _mach_base_info = {};
#endif
#if !( \
(defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700) \
|| (defined(__APPLE__) && defined(__MACH__)))
#ifdef _WIN32
char* strndup(const char* src, size_t size)
{
size_t len = strnlen(src, size);
@@ -60,13 +58,10 @@ char* strndup(const char* src, size_t size)
dst[len] = '\0';
return dst;
}
#endif // !((defined (_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700) ||
// (defined(__APPLE__) && defined(__MACH__)))
#ifdef _WIN32
static uint32_t _frequency = 0;
static LARGE_INTEGER _entryTimestamp;
#endif
#endif // _WIN32
using update_palette_func = void (*)(const uint8_t*, int32_t, int32_t);