diff options
author | Andy Polyakov <appro@openssl.org> | 2014-09-25 00:32:56 +0200 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2014-10-17 11:55:02 +0200 |
commit | 56cee260d8ea15e58ba843ba91c632b797da58ff (patch) | |
tree | bc7fa2ab0b2d0f1ca00a2d13f6a6ce14a7ac1999 /e_os.h | |
parent | e2e13b8f3aaf5dc8079ead88fd6869c848681cd3 (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)
Diffstat (limited to 'e_os.h')
-rw-r--r-- | e_os.h | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -378,15 +378,6 @@ static unsigned int _strlen31(const char *str) # define check_winnt() (GetVersion() < 0x80000000) #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 @@ -753,6 +744,22 @@ struct servent *getservbyname(const char *name, const char *proto); #include <OS.h> #endif +#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 } |