mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-06-05 21:15:16 +00:00
Merge remote-tracking branch 'development' into merge-development-restricted-20260309
This commit is contained in:
@@ -33,6 +33,14 @@
|
||||
*/
|
||||
#include "mbedtls_platform_requirements.h"
|
||||
|
||||
/* Mbed TLS is tightly coupled with TF-PSA-Crypto, and inherits all of
|
||||
* its platform requirements because we don't have a clear separation of
|
||||
* public vs private platform interfaces. So make sure we declare the
|
||||
* TF-PSA-Crypto platform requirements. We need to do that before including
|
||||
* any system headers, thus before including the user config file since it
|
||||
* may include platform headers. */
|
||||
#include "tf_psa_crypto_platform_requirements.h"
|
||||
|
||||
/* From this point onwards, ensure we have the library configuration and
|
||||
* the configuration-derived macros. */
|
||||
#include <mbedtls/build_info.h>
|
||||
|
||||
@@ -15,6 +15,20 @@
|
||||
#ifndef MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H
|
||||
#define MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE)
|
||||
/* For standards-compliant access to
|
||||
* getaddrinfo(),
|
||||
* ... */
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
|
||||
#if !defined(_XOPEN_SOURCE)
|
||||
/* For standards-compliant access to
|
||||
* sockaddr_storage,
|
||||
* ... */
|
||||
#define _XOPEN_SOURCE 600
|
||||
#endif
|
||||
|
||||
/* On Mingw-w64, force the use of a C99-compliant printf() and friends.
|
||||
* This is necessary on older versions of Mingw and/or Windows runtimes
|
||||
* where snprintf does not always zero-terminate the buffer, and does
|
||||
@@ -29,4 +43,13 @@
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
|
||||
/* Tell MSVC that we're ok with using classic C functions even
|
||||
* when an `_s` variant exist. For most functions, the improvements
|
||||
* of the `_s` variants are of limited usefulness and not worth
|
||||
* the portability headaches.
|
||||
*/
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
#endif /* MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H */
|
||||
|
||||
+1
-13
@@ -5,23 +5,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
/* Enable definition of getaddrinfo() even when compiling with -std=c99. Must
|
||||
* be set before mbedtls_config.h, which pulls in glibc's features.h indirectly.
|
||||
* Harmless on other platforms. */
|
||||
#ifndef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
#ifndef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 600 /* sockaddr_storage */
|
||||
#endif
|
||||
|
||||
#include "ssl_misc.h"
|
||||
|
||||
#if defined(MBEDTLS_NET_C)
|
||||
|
||||
#if !defined(unix) && !defined(__unix__) && !defined(__unix) && \
|
||||
!defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \
|
||||
!defined(__HAIKU__) && !defined(__midipix__)
|
||||
#if !defined(MBEDTLS_PLATFORM_IS_UNIXLIKE) && !defined(_WIN32)
|
||||
#error "This module only works on Unix and Windows, see MBEDTLS_NET_C in mbedtls_config.h"
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user