Force the use of our indent profile
[openssl.git] / e_os.h
diff --git a/e_os.h b/e_os.h
index 79c1392573405d07876caabd734a41b660a39bbc..8fddd18f9622b0ebea0a33a9aede131b4bdaa6a3 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -290,7 +290,7 @@ extern "C" {
 #    ifdef _WIN64
 #      define strlen(s) _strlen31(s)
 /* cut strings to 2GB */
-static unsigned int _strlen31(const char *str)
+static __inline unsigned int _strlen31(const char *str)
        {
        unsigned int len=0;
        while (*str && len<0x80000000U) str++, len++;
@@ -368,6 +368,15 @@ static unsigned int _strlen31(const char *str)
 #    define DEFAULT_HOME  "C:"
 #  endif
 
+/* Avoid Visual Studio 13 GetVersion deprecated problems */
+#if defined(_MSC_VER) && _MSC_VER>=1800
+#  define check_winnt() (1)
+#  define check_win_minplat(x) (1)
+#else
+#  define check_winnt() (GetVersion() < 0x80000000)
+#  define check_win_minplat(x) (LOBYTE(LOWORD(GetVersion())) >= (x))
+#endif
+
 #else /* The non-microsoft world */
 
 #  ifdef OPENSSL_SYS_VMS
@@ -387,7 +396,8 @@ static unsigned int _strlen31(const char *str)
 #    define NUL_DEV            "NLA0:"
   /* We don't have any well-defined random devices on VMS, yet... */
 #    undef DEVRANDOM
-  /* We need to do this since VMS has the following coding on status codes:
+  /*-
+     We need to do this since VMS has the following coding on status codes:
 
      Bits 0-2: status type: 0 = warning, 1 = success, 2 = error, 3 = info ...
                The important thing to know is that odd numbers are considered
@@ -725,10 +735,25 @@ 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__>=2
+#  define 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 inline __inline
+# else
+#  define inline
+# endif
+#endif
 
 #ifdef  __cplusplus
 }
 #endif
 
 #endif
-