Unify the detection of Unix-like platforms

We were using slightly different guards to decide whether to include
`<unistd.h>` in different places. Unify those.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2026-01-16 18:55:24 +01:00
parent 5d479d8050
commit e8dec9c031
2 changed files with 4 additions and 3 deletions

3
ChangeLog.d/unistd.txt Normal file
View File

@@ -0,0 +1,3 @@
Changes
* Tweak the detection of Unix-like platforms, which makes more system
interfaces (timing, threading) available on Haiku, QNX and Midipix.

View File

@@ -19,9 +19,7 @@
#if defined(MBEDTLS_NET_C) #if defined(MBEDTLS_NET_C)
#if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ #if !defined(MBEDTLS_PLATFORM_IS_UNIXLIKE) && !defined(_WIN32)
!defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \
!defined(__HAIKU__) && !defined(__midipix__)
#error "This module only works on Unix and Windows, see MBEDTLS_NET_C in mbedtls_config.h" #error "This module only works on Unix and Windows, see MBEDTLS_NET_C in mbedtls_config.h"
#endif #endif