fix build for midipix

Signed-off-by: Ørjan Malde <red@foxi.me>
This commit is contained in:
Ørjan Malde 2024-01-26 12:51:35 +00:00
parent 935182fe2b
commit 2a6cb5c881
2 changed files with 7 additions and 6 deletions

View file

@ -5,7 +5,7 @@
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/ */
#if defined(__linux__) && !defined(_GNU_SOURCE) #if defined(__linux__) || defined(__midipix__) && !defined(_GNU_SOURCE)
/* Ensure that syscall() is available even when compiling with -std=c99 */ /* Ensure that syscall() is available even when compiling with -std=c99 */
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif

View file

@ -151,10 +151,10 @@ void mbedtls_zeroize_and_free(void *buf, size_t len)
#include <time.h> #include <time.h>
#if !defined(_WIN32) && (defined(unix) || \ #if !defined(_WIN32) && (defined(unix) || \
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \ defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
defined(__MACH__))) defined(__MACH__)) || defined__midipix__)
#include <unistd.h> #include <unistd.h>
#endif /* !_WIN32 && (unix || __unix || __unix__ || #endif /* !_WIN32 && (unix || __unix || __unix__ ||
* (__APPLE__ && __MACH__)) */ * (__APPLE__ && __MACH__) || __midipix__) */
#if !((defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || \ #if !((defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || \
(defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \ (defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \
@ -222,9 +222,10 @@ void (*mbedtls_test_hook_test_fail)(const char *, int, const char *);
#include <time.h> #include <time.h>
#if !defined(_WIN32) && \ #if !defined(_WIN32) && \
(defined(unix) || defined(__unix) || defined(__unix__) || \ (defined(unix) || defined(__unix) || defined(__unix__) || \
(defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__)) (defined(__APPLE__) && defined(__MACH__)) || defined(__HAIKU__) || defined(__midipix__))
#include <unistd.h> #include <unistd.h>
#endif /* !_WIN32 && (unix || __unix || __unix__ || (__APPLE__ && __MACH__) || __HAIKU__) */ #endif \
/* !_WIN32 && (unix || __unix || __unix__ || (__APPLE__ && __MACH__) || __HAIKU__ || __midipix__) */
#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 199309L) || defined(__HAIKU__) #if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 199309L) || defined(__HAIKU__)
mbedtls_ms_time_t mbedtls_ms_time(void) mbedtls_ms_time_t mbedtls_ms_time(void)
{ {
@ -232,7 +233,7 @@ mbedtls_ms_time_t mbedtls_ms_time(void)
struct timespec tv; struct timespec tv;
mbedtls_ms_time_t current_ms; mbedtls_ms_time_t current_ms;
#if defined(__linux__) && defined(CLOCK_BOOTTIME) #if defined(__linux__) && defined(CLOCK_BOOTTIME) || defined(__midipix__)
ret = clock_gettime(CLOCK_BOOTTIME, &tv); ret = clock_gettime(CLOCK_BOOTTIME, &tv);
#else #else
ret = clock_gettime(CLOCK_MONOTONIC, &tv); ret = clock_gettime(CLOCK_MONOTONIC, &tv);