mirror of
https://github.com/espressif/mbedtls.git
synced 2025-05-09 19:31:18 +08:00
Remove useless platform macro redefinitions: automatic part
Some source files had code to set mbedtls_xxx aliases when MBEDTLS_PLATFORM_C is not defined. These aliases are defined unconditionally by mbedtls/platform.h, so these macro definitions were redundant. Remove them. This commit used the following code: ``` perl -i -0777 -pe 's~#if !defined\(MBEDTLS_PLATFORM_C\)\n(#define (mbedtls|MBEDTLS)_.*\n|#include <(stdarg|stddef|stdio|stdlib|string|time)\.h>\n)*#endif.*\n~~mg' $(git grep -l -F '#if !defined(MBEDTLS_PLATFORM_C)') ``` Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
8474fe072b
commit
093a4aa51b
@ -44,10 +44,6 @@
|
|||||||
#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
|
#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
|
||||||
#include "mbedtls/aes.h"
|
#include "mbedtls/aes.h"
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#include <stdio.h>
|
|
||||||
#define mbedtls_printf printf
|
|
||||||
#endif /* MBEDTLS_PLATFORM_C */
|
|
||||||
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
|
#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_GCM_ALT)
|
#if !defined(MBEDTLS_GCM_ALT)
|
||||||
|
@ -51,10 +51,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#define mbedtls_calloc calloc
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mbedtls/aes.h"
|
#include "mbedtls/aes.h"
|
||||||
#include "mbedtls/arc4.h"
|
#include "mbedtls/arc4.h"
|
||||||
|
@ -25,10 +25,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#define mbedtls_calloc calloc
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void psa_reset_key_attributes( psa_key_attributes_t *attributes )
|
void psa_reset_key_attributes( psa_key_attributes_t *attributes )
|
||||||
{
|
{
|
||||||
|
@ -31,10 +31,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#define mbedtls_calloc calloc
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <mbedtls/ecdsa.h>
|
#include <mbedtls/ecdsa.h>
|
||||||
#include <mbedtls/ecp.h>
|
#include <mbedtls/ecp.h>
|
||||||
|
@ -31,10 +31,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#define mbedtls_calloc calloc
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <mbedtls/rsa.h>
|
#include <mbedtls/rsa.h>
|
||||||
#include <mbedtls/error.h>
|
#include <mbedtls/error.h>
|
||||||
|
@ -38,10 +38,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#define mbedtls_calloc calloc
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,13 +24,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
#if !defined(MBEDTLS_PLATFORM_C)
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#define mbedtls_exit exit
|
|
||||||
#define mbedtls_printf printf
|
|
||||||
#define mbedtls_free free
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_TIMING_C)
|
#if !defined(MBEDTLS_TIMING_C)
|
||||||
int main( void )
|
int main( void )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user