From e9b10b21f11a84a8fbf74ce663935c7caea563fa Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Wed, 5 Sep 2018 11:25:30 +0100 Subject: [PATCH] Define _POSIX_C_SOURCE in threading.c before POSIX detection --- library/threading.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/threading.c b/library/threading.c index 3d7f61b2e..c22a1dadc 100644 --- a/library/threading.c +++ b/library/threading.c @@ -19,6 +19,12 @@ * This file is part of mbed TLS (https://tls.mbed.org) */ +/* + * Ensure gmtime_r is available even with -std=c99; must be included before + * config.h, which pulls in glibc's features.h. Harmless on other platforms. + */ +#define _POSIX_C_SOURCE 200112L + #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" #else