From 94b540ac63c0c8d9d87edff9772dc7754bd4d220 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Wed, 5 Sep 2018 12:27:32 +0100 Subject: [PATCH] Avoid redefining _POSIX_C_SOURCE --- include/mbedtls/threading.h | 2 ++ library/platform_util.c | 2 ++ library/threading.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/mbedtls/threading.h b/include/mbedtls/threading.h index dc724eee2..1b13deb3e 100644 --- a/include/mbedtls/threading.h +++ b/include/mbedtls/threading.h @@ -28,7 +28,9 @@ * 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. */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 200112L +#endif #if !defined(MBEDTLS_CONFIG_FILE) #include "config.h" diff --git a/library/platform_util.c b/library/platform_util.c index 9bcf15e6a..6a5feb321 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -24,7 +24,9 @@ * 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. */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 200112L +#endif #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" diff --git a/library/threading.c b/library/threading.c index 7231f2f9b..c1834bace 100644 --- a/library/threading.c +++ b/library/threading.c @@ -23,7 +23,9 @@ * 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. */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 200112L +#endif #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h"