From b30aaafbe5a94c3a6b8f665e13b51d12b3c662b1 Mon Sep 17 00:00:00 2001 From: Emilia Kasper Date: Tue, 19 Aug 2014 13:18:07 +0200 Subject: [PATCH] define inline for Visual Studio In Visual Studio, inline is available in C++ only, however __inline is available for C, see http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx Reviewed-by: Richard Levitte Reviewed-by: Dr Stephen Henson (cherry picked from commit f511b25a7370c775dc9fd6198dbacd1706cf242b) Conflicts: e_os.h --- e_os.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/e_os.h b/e_os.h index cc90f5e8ca..532ec6bebf 100644 --- a/e_os.h +++ b/e_os.h @@ -360,7 +360,16 @@ static unsigned int _strlen31(const char *str) # define DEFAULT_HOME "C:" # endif -#else /* The non-microsoft world world */ +/* + * Visual Studio: inline is available in C++ only, however + * __inline is available for C, see + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + */ +#if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline) +# define inline __inline +#endif + +#else /* The non-microsoft world */ # ifdef OPENSSL_SYS_VMS # define VMS 1 @@ -707,4 +716,3 @@ struct servent *getservbyname(const char *name, const char *proto); #endif #endif -