mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-20 19:21:09 +01:00
Merge pull request #10606 from gilles-peskine-arm/unix-detection-202601-4.0
Simplify platform requirements before 4.1
This commit is contained in:
3
ChangeLog.d/unistd.txt
Normal file
3
ChangeLog.d/unistd.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Changes
|
||||
* Tweak the detection of Unix-like platforms, which makes more system
|
||||
interfaces (timing, threading) available on Haiku, QNX and Midipix.
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -17,6 +17,15 @@
|
||||
#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
|
||||
|
||||
#define MBEDTLS_ALLOW_PRIVATE_ACCESS
|
||||
|
||||
#include "mbedtls/private/pk_private.h"
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
/* 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
|
||||
|
||||
#include "mbedtls/build_info.h"
|
||||
|
||||
#include "mbedtls/platform.h"
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
/* 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
|
||||
|
||||
#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
|
||||
|
||||
#include "mbedtls/build_info.h"
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
/* 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
|
||||
|
||||
#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
|
||||
|
||||
#include "mbedtls/build_info.h"
|
||||
|
||||
Submodule tf-psa-crypto updated: 4587e3f861...293cfe5ece
Reference in New Issue
Block a user