summaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-09-25 00:32:56 +0200
committerEmilia Kasper <emilia@openssl.org>2014-10-17 12:00:53 +0200
commitaf32df0a8e662914f78c93736466c746f83dfe84 (patch)
treeda3be518038a07d99823f347890d4b7e1c69d965 /e_os.h
parentbfb7bf1a28292734c53cce2297dc5b53c6614a6f (diff)
e_os.h: allow inline functions to be compiled by legacy compilers.
Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 40155f408985aff2e9f1b61b7cb04a3e518633a1) Conflicts: e_os.h
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/e_os.h b/e_os.h
index 532ec6bebf..960959a486 100644
--- a/e_os.h
+++ b/e_os.h
@@ -360,15 +360,6 @@ static unsigned int _strlen31(const char *str)
# define DEFAULT_HOME "C:"
# 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 */
# ifdef OPENSSL_SYS_VMS
@@ -711,6 +702,23 @@ struct servent *getservbyname(const char *name, const char *proto);
#endif
/* end vxworks */
+#if !defined(inline) && !defined(__cplusplus)
+# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
+ /* do nothing, inline works */
+# elif defined(__GNUC__) && __GNUC__>=3 && !defined(__NO_INLINE__)
+ /* do nothing, inline works */
+# elif defined(_MSC_VER)
+ /*
+ * Visual Studio: inline is available in C++ only, however
+ * __inline is available for C, see
+ * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx
+ */
+# define inline __inline
+# else
+# define inline
+# endif
+#endif
+
#ifdef __cplusplus
}
#endif