define inline for Visual Studio
authorEmilia Kasper <emilia@openssl.org>
Tue, 19 Aug 2014 11:18:07 +0000 (13:18 +0200)
committerEmilia Kasper <emilia@openssl.org>
Thu, 21 Aug 2014 13:56:58 +0000 (15:56 +0200)
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 <levitte@openssl.org>
Reviewed-by: Dr Stephen Henson <steve@openssl.org>
e_os.h

diff --git a/e_os.h b/e_os.h
index 0a97895360d71407e2be33279641421728ac796e..ced9483ab00ec41d0277ef9b8b0add5a590665ea 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -379,7 +379,16 @@ static unsigned int _strlen31(const char *str)
 #  define check_winnt() (1)
 #else
 #  define check_winnt() (GetVersion() < 0x80000000)
 #  define check_winnt() (1)
 #else
 #  define check_winnt() (GetVersion() < 0x80000000)
-#endif 
+#endif
+
+/*
+ * 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 */
 
 
 #else /* The non-microsoft world */
 
@@ -754,4 +763,3 @@ struct servent *getservbyname(const char *name, const char *proto);
 #endif
 
 #endif
 #endif
 
 #endif
-