Fix macroization of inline in C++

When compiling as C++, MSVC complains about our macroization of a keyword.
Stop doing that as we know inline is always available in C++
This commit is contained in:
Manuel Pégourié-Gonnard 2015-10-05 11:40:01 +01:00
parent ded3ae500b
commit 20607bb0fa
8 changed files with 19 additions and 36 deletions

View File

@ -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' keywork when building as C++. (#279)
= mbed TLS 1.3.13 released 2015-09-17

View File

@ -47,10 +47,8 @@
#define POLARSSL_CIPHER_MODE_STREAM
#endif
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */

View File

@ -41,13 +41,10 @@
// Comment out to disable prototype change warnings
#define SHOW_PROTOTYPE_CHANGE_WARNINGS
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /* _MSC_VER */
#endif
#if defined(_MSC_VER)
// MSVC does not support #warning

View File

@ -28,13 +28,10 @@
#include <stddef.h>
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */
#endif
#define POLARSSL_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */
#define POLARSSL_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */

View File

@ -38,10 +38,8 @@
#include <pkcs11-helper-1.0/pkcs11h-certificate.h>
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */

View File

@ -97,13 +97,10 @@
#define POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED
#endif
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */
#endif
/*
* SSL Error codes

View File

@ -68,13 +68,10 @@
#define strcasecmp _stricmp
#endif
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */
#endif
/* Implementation that should never be optimized out by the compiler */
static void polarssl_zeroize( void *v, size_t n ) {

View File

@ -32,10 +32,8 @@
#include <string.h>
#if defined(_MSC_VER) && !defined(inline)
#define inline _inline
#else
#if defined(__ARMCC_VERSION) && !defined(inline)
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
!defined(inline) && !defined(__cplusplus)
#define inline __inline
#endif /* __ARMCC_VERSION */
#endif /*_MSC_VER */