From 31f88a29dee0b8ab5d93c34e83d118daf01a7b21 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 14 Apr 2020 19:39:56 +0200 Subject: [PATCH] Strict C99: make sure that fileno() is declared only declares the non-ISO-C function fileno() if an appropriate POSIX symbol is defined or if using a compiler such as GCC in non-pedantic mode. Define the appropriate POSIX symbol. Signed-off-by: Gilles Peskine --- tests/suites/main_test.function | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index a1ba610585..db1c88a80e 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -19,6 +19,12 @@ * This file is part of Mbed TLS (https://tls.mbed.org) */ +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#if !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 1 // for fileno() from +#endif +#endif + #if !defined(MBEDTLS_CONFIG_FILE) #include #else