From c0bb66f47ea6101ba077f7a037ebd52a85574c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 28 Feb 2018 12:38:04 +0100 Subject: [PATCH] aria: improve compiler inline compatibility --- library/aria.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/library/aria.c b/library/aria.c index 41ed7599a..a9b88713d 100644 --- a/library/aria.c +++ b/library/aria.c @@ -48,6 +48,11 @@ #if !defined(MBEDTLS_ARIA_ALT) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) +#define inline __inline +#endif + /* Implementation that should never be optimized out by the compiler */ static void mbedtls_zeroize( void *v, size_t n ) { volatile unsigned char *p = (unsigned char*)v; while( n-- ) *p++ = 0; @@ -97,7 +102,7 @@ static inline uint32_t aria_p1( uint32_t x ) } #define ARIA_P1 aria_p1 #elif defined(__ARMCC_VERSION) && __ARMCC_VERSION < 6000000 -static __inline uint32_t aria_p1( uint32_t x ) +static inline uint32_t aria_p1( uint32_t x ) { uint32_t r; __asm( "rev16 r, x" ); @@ -146,7 +151,7 @@ static inline uint32_t aria_p3( uint32_t x ) } #define ARIA_P3 aria_p3 #elif defined(__ARMCC_VERSION) && __ARMCC_VERSION < 6000000 -static __inline uint32_t aria_p3( uint32_t x ) +static inline uint32_t aria_p3( uint32_t x ) { uint32_t r; __asm( "rev r, x" );