From 20af64dc2cc387868b44b2cfa8b1d521d594308c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 7 Jul 2015 18:33:39 +0200 Subject: [PATCH] Still need to #define inline for MSVC I only tested with VS2015 earlier, but previous versions apparently still don't know that standard C99 keyword though it's documented on MSDN... --- include/mbedtls/cipher.h | 4 ++-- include/mbedtls/md.h | 4 ++-- include/mbedtls/pkcs11.h | 4 ++-- include/mbedtls/ssl_internal.h | 4 ++-- library/ecp.c | 4 ++-- library/ecp_curves.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h index 38cdf2977..7c2d303ad 100644 --- a/include/mbedtls/cipher.h +++ b/include/mbedtls/cipher.h @@ -47,9 +47,9 @@ #define MBEDTLS_CIPHER_MODE_STREAM #endif -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif #define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -0x6080 /**< The selected feature is not available. */ #define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -0x6100 /**< Bad input parameters to function. */ diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h index 9465a5a41..2a6cc0c7b 100644 --- a/include/mbedtls/md.h +++ b/include/mbedtls/md.h @@ -28,9 +28,9 @@ #include -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif #define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */ #define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */ diff --git a/include/mbedtls/pkcs11.h b/include/mbedtls/pkcs11.h index 4855331f8..05def7be9 100644 --- a/include/mbedtls/pkcs11.h +++ b/include/mbedtls/pkcs11.h @@ -38,9 +38,9 @@ #include -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif #ifdef __cplusplus extern "C" { diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index eebc2149c..da81f56e6 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -42,9 +42,9 @@ #include "sha512.h" #endif -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif /* Determine minimum supported version */ #define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 diff --git a/library/ecp.c b/library/ecp.c index 16961e5f1..c5464e30c 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -63,9 +63,9 @@ #define mbedtls_free free #endif -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif /* Implementation that should never be optimized out by the compiler */ static void mbedtls_zeroize( void *v, size_t n ) { diff --git a/library/ecp_curves.c b/library/ecp_curves.c index c8a320ca6..c21e0a071 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -32,9 +32,9 @@ #include -#if defined(__ARMCC_VERSION) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) #define inline __inline -#endif /* __ARMCC_VERSION */ +#endif /* * Conversion macros for embedded constants: