diff --git a/ChangeLog b/ChangeLog index e3353d0d4..c15e33536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ mbed TLS ChangeLog (Sorted per branch, date) Bugfix * Fix compile error in net.c with musl libc. Found and patch provided by zhasha (#278). + * Fix macroization of 'inline' keyword when building as C++. (#279) Changes * Fixed paths for check_config.h in example config files. (Found by bachp) diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h index 87d9c79f5..70000f5e6 100644 --- a/include/mbedtls/cipher.h +++ b/include/mbedtls/cipher.h @@ -46,7 +46,8 @@ #define MBEDTLS_CIPHER_MODE_STREAM #endif -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h index 1834b5992..77c2c6f68 100644 --- a/include/mbedtls/md.h +++ b/include/mbedtls/md.h @@ -27,10 +27,6 @@ #include -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) -#define inline __inline -#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. */ #define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */ diff --git a/include/mbedtls/pkcs11.h b/include/mbedtls/pkcs11.h index 7632929cb..2e8892813 100644 --- a/include/mbedtls/pkcs11.h +++ b/include/mbedtls/pkcs11.h @@ -37,7 +37,8 @@ #include -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif diff --git a/include/mbedtls/ssl_internal.h b/include/mbedtls/ssl_internal.h index 73279a5ae..78c748cfa 100644 --- a/include/mbedtls/ssl_internal.h +++ b/include/mbedtls/ssl_internal.h @@ -41,7 +41,8 @@ #include "sha512.h" #endif -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif diff --git a/library/debug.c b/library/debug.c index 070f63a72..4752ab1a3 100644 --- a/library/debug.c +++ b/library/debug.c @@ -42,7 +42,8 @@ #define mbedtls_snprintf snprintf #endif -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif diff --git a/library/ecp.c b/library/ecp.c index 858540be2..64a47ab52 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -62,7 +62,8 @@ #define mbedtls_free free #endif -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif diff --git a/library/ecp_curves.c b/library/ecp_curves.c index 68323c582..9a6e8eb18 100644 --- a/library/ecp_curves.c +++ b/library/ecp_curves.c @@ -31,7 +31,8 @@ #include -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && !defined(inline) +#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ + !defined(inline) && !defined(__cplusplus) #define inline __inline #endif