summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilia Kasper <emilia@openssl.org>2014-08-19 13:18:07 +0200
committerEmilia Kasper <emilia@openssl.org>2014-08-21 16:07:55 +0200
commit41a765182ff10738aeab131661ff9a3e1039b1a2 (patch)
treefe14922b23550d791b969e6ce84389e9c230a33a
parentbcdd904c6c55623098fcd6f19fc2b3404f2407cf (diff)
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 <levitte@openssl.org> Reviewed-by: Dr Stephen Henson <steve@openssl.org> (cherry picked from commit f511b25a7370c775dc9fd6198dbacd1706cf242b)
-rw-r--r--e_os.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/e_os.h b/e_os.h
index 6a0aad1de7..733155e48d 100644
--- a/e_os.h
+++ b/e_os.h
@@ -373,7 +373,16 @@ static unsigned int _strlen31(const char *str)
# 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 */
@@ -738,4 +747,3 @@ struct servent *getservbyname(const char *name, const char *proto);
#endif
#endif
-