Enable WinCE build without deceiving _MSC_VER.
authoraSoujyuTanaka <soujyu.tanaka@access-company.com>
Sat, 11 Apr 2020 19:10:57 +0000 (04:10 +0900)
committerRichard Levitte <levitte@openssl.org>
Wed, 15 Jul 2020 21:03:22 +0000 (23:03 +0200)
Reviewed-by: Mark J. Cox <mark@awe.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11526)

crypto/o_str.c
crypto/o_time.c
crypto/rand/randfile.c
e_os.h
include/openssl/e_os2.h

index 8aa1a2a4ddf575908d36d6d4183c9cf18bface1f..cfc401427decf210390c5e3806d75268d78d6087 100644 (file)
@@ -287,7 +287,7 @@ char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen)
 
 int openssl_strerror_r(int errnum, char *buf, size_t buflen)
 {
-#if defined(_MSC_VER) && _MSC_VER>=1400
+#if defined(_MSC_VER) && _MSC_VER>=1400 && !defined(_WIN32_WCE)
     return !strerror_s(buf, buflen, errnum);
 #elif defined(_GNU_SOURCE)
     char *err;
index f0e3e472e000528a7be1a14ec109dbb71db81eb7..695f5c2938c73d61c8c989c1036dd703986fbf2e 100644 (file)
@@ -41,7 +41,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
     if (gmtime_r(timer, result) == NULL)
         return NULL;
     ts = result;
-#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400
+#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(_WIN32_WCE)
     if (gmtime_s(result, timer))
         return NULL;
     ts = result;
index 7dde54b18726ca1f2a5319924f1f33532703856a..cbc2720918a938272946dee630ada2e99885e662 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef OPENSSL_NO_POSIX_IO
 # include <sys/stat.h>
 # include <fcntl.h>
-# ifdef _WIN32
+# if defined(_WIN32) && !defined(_WIN32_WCE)
 #  include <windows.h>
 #  include <io.h>
 #  define stat    _stat
diff --git a/e_os.h b/e_os.h
index d354c6950c219725bdab012db617f9d933a353f7..c035568464575684d711a759d3116a8048d94e7b 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -258,7 +258,7 @@ extern FILE *_imp___iob;
 # if defined(OPENSSL_SYS_WINDOWS)
 #  define strcasecmp _stricmp
 #  define strncasecmp _strnicmp
-#  if (_MSC_VER >= 1310)
+#  if (_MSC_VER >= 1310) && !defined(_WIN32_WCE)
 #   define open _open
 #   define fdopen _fdopen
 #   define close _close
index 982dd2b8a72094c0ecc11c83b37e28c827ee2fe0..aab4ef38a793e3ba647324ec47b678beba1f4e93 100644 (file)
@@ -220,7 +220,7 @@ typedef UINT64 uint64_t;
 #  undef OPENSSL_NO_INTTYPES_H
 /* Because the specs say that inttypes.h includes stdint.h if present */
 #  undef OPENSSL_NO_STDINT_H
-# elif defined(_MSC_VER) && _MSC_VER<=1500
+# elif defined(_MSC_VER) && _MSC_VER<1600
 /*
  * minimally required typdefs for systems not supporting inttypes.h or
  * stdint.h: currently just older VC++