mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-20 11:11:08 +01:00
Create a header to declare platform requirements
On some platforms, the system headers expose different interfaces depending on what macros are defined, for example to provide different standards compliance level. Create a common place where we can declare such macros, so that our code can behave in the same way when it's in different files. Individual .c files can still override these requirements by defining macros before including the common header, if it's really necessary. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -11,6 +11,16 @@
|
||||
#ifndef MBEDTLS_MBEDTLS_COMMON_H
|
||||
#define MBEDTLS_MBEDTLS_COMMON_H
|
||||
|
||||
/* Before including any system header, declare some macros to tell system
|
||||
* headers what we expect of them.
|
||||
*
|
||||
* Do this before including any header from TF-PSA-Crypto, since the
|
||||
* convention is first-come-first-served (so that users can
|
||||
* override some macros on the command line, and individual users can
|
||||
* override some macros before including the common header).
|
||||
*/
|
||||
#include "mbedtls_platform_requirements.h"
|
||||
|
||||
/* Mbed TLS requires TF-PSA-Crypto internals. */
|
||||
#include "tf_psa_crypto_common.h"
|
||||
|
||||
|
||||
18
library/mbedtls_platform_requirements.h
Normal file
18
library/mbedtls_platform_requirements.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* \file mbedtls_platform_requirements.h
|
||||
*
|
||||
* \brief Declare macros that tell system headers what we expect of them.
|
||||
*
|
||||
* This file must be included before any system header, and so in particular
|
||||
* before build_info.h (which includes the user config, which may include
|
||||
* system headers).
|
||||
*/
|
||||
/*
|
||||
* Copyright The Mbed TLS Contributors
|
||||
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H
|
||||
#define MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H
|
||||
|
||||
#endif /* MBEDTLS_MBEDTLS_PLATFORM_REQUIREMENTS_H */
|
||||
Reference in New Issue
Block a user