From f5106d54ebadd74fc9e6ba2483858523b99d8d7a Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 6 Sep 2018 12:09:56 +0100 Subject: [PATCH] Don't declare and define gmtime()-mutex on Windows platforms --- include/mbedtls/threading.h | 3 +++ library/platform_util.c | 3 +++ library/threading.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/include/mbedtls/threading.h b/include/mbedtls/threading.h index 49ecdc30e..8fdb63343 100644 --- a/include/mbedtls/threading.h +++ b/include/mbedtls/threading.h @@ -124,7 +124,10 @@ extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex; * threading.c. Remember to update the code there when changing the conditions * here. */ +#if ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex; +#endif /* ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) */ + #endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \ ( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \ _POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */ diff --git a/library/platform_util.c b/library/platform_util.c index ca4d03312..ca5fe4fb8 100644 --- a/library/platform_util.c +++ b/library/platform_util.c @@ -94,7 +94,10 @@ void mbedtls_platform_zeroize( void *buf, size_t len ) * threading.h. However, this macro is not part of the Mbed TLS public API, so * we keep it private by only defining it in this file */ +#if ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) #define PLATFORM_UTIL_USE_GMTIME +#endif /* ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) */ + #endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \ ( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \ _POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */ diff --git a/library/threading.c b/library/threading.c index 8c1e25c17..7c90c7c59 100644 --- a/library/threading.c +++ b/library/threading.c @@ -56,7 +56,11 @@ * threading.h. However, this macro is not part of the Mbed TLS public API, so * we keep it private by only defining it in this file */ + +#if ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) #define THREADING_USE_GMTIME +#endif /* ! ( defined(_WIN32) && !defined(EFIX64) && !defined(EFI32) ) */ + #endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \ ( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \ _POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */