* For 32 bit environment, there seems to be the CygWin environment and then
* all the others that try to do the same thing Microsoft does...
*/
-# if defined(OPENSSL_SYS_UWIN)
+/*
+ * UEFI lives here because it might be built with a Microsoft toolchain and
+ * we need to avoid the false positive match on Windows.
+ */
+# if defined(OPENSSL_SYS_UEFI)
+# undef OPENSSL_SYS_UNIX
+# elif defined(OPENSSL_SYS_UWIN)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WIN32_UWIN
# else
# define OPENSSL_SYS_WIN32
# endif
# endif
+# if defined(_WIN64) || defined(OPENSSL_SYS_WIN64)
+# undef OPENSSL_SYS_UNIX
+# if !defined(OPENSSL_SYS_WIN64)
+# define OPENSSL_SYS_WIN64
+# endif
+# endif
# if defined(OPENSSL_SYS_WINNT)
# undef OPENSSL_SYS_UNIX
# endif
# endif
/* Anything that tries to look like Microsoft is "Windows" */
-# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
+# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
# undef OPENSSL_SYS_UNIX
# define OPENSSL_SYS_WINDOWS
# ifndef OPENSSL_SYS_MSDOS
# define OPENSSL_GLOBAL_REF(name) _shadow_##name
# endif
-# ifdef OPENSSL_SYS_MSDOS
-# define ossl_ssize_t long
+# ifdef _WIN32
+# ifdef _WIN64
+# define ossl_ssize_t __int64
+# else
+# define ossl_ssize_t int
+# endif
# endif
# if defined(__ultrix) && !defined(ssize_t)
/* Standard integer types */
# if defined(__osf__) || defined(__sgi) || defined(__hpux) || defined(OPENSSL_SYS_VMS)
# include <inttypes.h>
+# elif defined(OPENSSL_SYS_UEFI)
+typedef INT8 int8_t;
+typedef UINT8 uint8_t;
+typedef INT16 int16_t;
+typedef UINT16 uint16_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+typedef INT64 int64_t;
+typedef UINT64 uint64_t;
# elif defined(_MSC_VER) && _MSC_VER<=1500
/*
* minimally required typdefs for systems not supporting inttypes.h or
typedef unsigned int uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
-
-# include <limits.h>
-
-# define INT8_MAX SCHAR_MAX
-# define INT8_MIN SCHAR_MIN
-# define UINT8_MAX UCHAR_MAX
-
-# define INT16_MAX SHRT_MAX
-# define INT16_MIN SHRT_MIN
-# define UINT16_MAX USHRT_MAX
-
-# define INT32_MAX INT_MAX
-# define INT32_MIN INT_MIN
-# define UINT32_MAX UINT_MAX
-
-# define INT64_MAX _I64_MAX
-# define INT64_MIN _I64_MIN
-# define UINT64_MAX _UI64_MAX
-
# else
# include <stdint.h>
# endif
+/*
+ * We need a format operator for some client tools for uint64_t.
+ * This is an attempt at doing so in a portable manner.
+ * If we can't use a built-in definition, we'll revert to the previous
+ * behavior that was hard-coded but now causing compiler warnings on
+ * some systems (e.g. Mac OS X).
+ */
+# ifndef PRIu64
+# if (__STDC_VERSION__ >= 199901L)
+# include <inttypes.h>
+# endif
+# ifndef PRIu64
+# define PRIu64 "lu"
+# endif
+# endif
+
#ifdef __cplusplus
}
#endif