mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-22 11:21:11 +00:00
Correct POSIX version check to determine presence of gmtime_r()
Recent versions of POSIX move gmtime_r to the base.
This commit is contained in:
parent
c52ef407ba
commit
6f70581c4a
|
@ -112,14 +112,18 @@ extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex;
|
||||||
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
||||||
defined(__MACH__)))
|
defined(__MACH__)))
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if !defined(_POSIX_VERSION) || 200112L > _POSIX_THREAD_SAFE_FUNCTIONS
|
#if !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) )
|
||||||
/*
|
/*
|
||||||
* The preprocessor conditions above are the same as in platform_util.c and
|
* The preprocessor conditions above are the same as in platform_util.c and
|
||||||
* threading.c. Remember to update the code there when changing the conditions
|
* threading.c. Remember to update the code there when changing the conditions
|
||||||
* here.
|
* here.
|
||||||
*/
|
*/
|
||||||
extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex;
|
extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex;
|
||||||
#endif /* !_POSIX_VERSION || 200112L > _POSIX_THREAD_SAFE_FUNCTIONS */
|
#endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */
|
||||||
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
||||||
* (__APPLE__ && __MACH__)) */
|
* (__APPLE__ && __MACH__)) */
|
||||||
#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */
|
#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */
|
||||||
|
|
|
@ -81,7 +81,10 @@ void mbedtls_platform_zeroize( void *buf, size_t len )
|
||||||
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
||||||
defined(__MACH__)))
|
defined(__MACH__)))
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if !defined(_POSIX_VERSION) || _POSIX_C_SOURCE > _POSIX_THREAD_SAFE_FUNCTIONS
|
|
||||||
|
#if !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) )
|
||||||
/*
|
/*
|
||||||
* This is a convenience shorthand macro to avoid checking the long
|
* This is a convenience shorthand macro to avoid checking the long
|
||||||
* preprocessor conditions above. Ideally, we could expose this macro in
|
* preprocessor conditions above. Ideally, we could expose this macro in
|
||||||
|
@ -90,7 +93,9 @@ void mbedtls_platform_zeroize( void *buf, size_t len )
|
||||||
* we keep it private by only defining it in this file
|
* we keep it private by only defining it in this file
|
||||||
*/
|
*/
|
||||||
#define PLATFORM_UTIL_USE_GMTIME
|
#define PLATFORM_UTIL_USE_GMTIME
|
||||||
#endif /* !_POSIX_VERSION || _POSIX_C_SOURCE > _POSIX_THREAD_SAFE_FUNCTIONS */
|
#endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */
|
||||||
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
||||||
* (__APPLE__ && __MACH__)) */
|
* (__APPLE__ && __MACH__)) */
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,9 @@
|
||||||
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
defined(__unix) || defined(__unix__) || (defined(__APPLE__) && \
|
||||||
defined(__MACH__)))
|
defined(__MACH__)))
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#if !defined(_POSIX_VERSION) || 200112L > _POSIX_THREAD_SAFE_FUNCTIONS
|
#if !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) )
|
||||||
/*
|
/*
|
||||||
* This is a convenience shorthand macro to avoid checking the long
|
* This is a convenience shorthand macro to avoid checking the long
|
||||||
* preprocessor conditions above. Ideally, we could expose this macro in
|
* preprocessor conditions above. Ideally, we could expose this macro in
|
||||||
|
@ -51,7 +53,9 @@
|
||||||
* we keep it private by only defining it in this file
|
* we keep it private by only defining it in this file
|
||||||
*/
|
*/
|
||||||
#define THREADING_USE_GMTIME
|
#define THREADING_USE_GMTIME
|
||||||
#endif /* !_POSIX_VERSION || 200112L > _POSIX_THREAD_SAFE_FUNCTIONS */
|
#endif /* !( ( defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ) || \
|
||||||
|
( defined(_POSIX_THREAD_SAFE_FUNCTIONS ) && \
|
||||||
|
_POSIX_THREAD_SAFE_FUNCTIONS >= 20112L ) ) */
|
||||||
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
#endif /* !_WIN32 && (unix || __unix || __unix__ ||
|
||||||
* (__APPLE__ && __MACH__)) */
|
* (__APPLE__ && __MACH__)) */
|
||||||
#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */
|
#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */
|
||||||
|
|
Loading…
Reference in a new issue