Fix c++ compilation
[openssl.git] / include / openssl / e_os2.h
index 23602a5266dc63c98f0fcf1e52630a26e40e60c5..3e7f16cbcf32241ce8e433bae853f4ddf908cc8c 100644 (file)
@@ -321,14 +321,37 @@ typedef unsigned __int64 uint64_t;
  * some systems (e.g. Mac OS X).
  */
 # ifndef PRIu64
-#  if (__STDC_VERSION__ >= 199901L)
-#   include <inttypes.h>
+#  ifdef __STDC_VERSION__
+#   if (__STDC_VERSION__ >= 199901L)
+#    include <inttypes.h>
+#   endif
 #  endif
 #  ifndef PRIu64
 #   define PRIu64 "lu"
 #  endif
 # endif
 
+/* ossl_inline: portable inline definition usable in public headers */
+# if !defined(inline) && !defined(__cplusplus)
+#  if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
+   /* just use inline */
+#   define ossl_inline inline
+#  elif defined(__GNUC__) && __GNUC__>=2
+#   define ossl_inline __inline__
+#  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 ossl_inline __inline
+#  else
+#   define ossl_inline
+#  endif
+# else
+#  define ossl_inline inline
+# endif
+
 #ifdef  __cplusplus
 }
 #endif