diff --git a/apps/apps.c b/apps/apps.c index 999dc80fc40e1a578644fb864c4dda263a464d78..d501eebd767cf6f33bfdd6f59d63d50809f4160c 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -118,7 +118,7 @@ #include #include #include -#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB) +#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB) #include #endif #include diff --git a/apps/apps.h b/apps/apps.h index 4b4ae8b38d488d8453cafd0bad80546936c78df4..5f083d409785e8001b138f82a07ca8cc7a59e344 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -204,7 +204,7 @@ extern BIO *bio_err; # endif #endif -#ifdef OPENSSL_SYSNAME_WIN32 +#if defined(OPENSSL_SYSNAME_WIN32) || defined(OPENSSL_SYSNAME_WINCE) # define openssl_fdset(a,b) FD_SET((unsigned int)a, b) #else # define openssl_fdset(a,b) FD_SET(a, b) diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index a20f264bfc69123436d6b3fd6efd63d257bf566a..6912aa1278b59113c9be83ebb13d1840ca21e5fe 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -66,7 +66,7 @@ #include #ifndef OPENSSL_NO_DGRAM -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) +#if defined(OPENSSL_SYS_VMS) #include #endif @@ -1895,11 +1895,15 @@ int BIO_dgram_non_fatal_error(int err) static void get_current_time(struct timeval *t) { -#ifdef OPENSSL_SYS_WIN32 - struct _timeb tb; - _ftime(&tb); - t->tv_sec = (long)tb.time; - t->tv_usec = (long)tb.millitm * 1000; +#if defined(_WIN32) + SYSTEMTIME st; + union { unsigned __int64 ul; FILETIME ft; } now; + + GetSystemTime(&st); + SystemTimeToFileTime(&st,&now.ft); + now.ul -= 116444736000000000UI64; /* re-bias to 1/1/1970 */ + t->tv_sec = (long)(now.ul/10000000); + t->tv_usec = ((int)(now.ul%10000000))/10; #elif defined(OPENSSL_SYS_VMS) struct timeb tb; ftime(&tb); diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c index d1bf85aae1750a0307b821e8b05f4b314693faa0..c274877c13086226b8114e0cde5b88d048217db9 100644 --- a/crypto/bio/bss_fd.c +++ b/crypto/bio/bss_fd.c @@ -63,9 +63,25 @@ #if defined(OPENSSL_NO_POSIX_IO) /* - * One can argue that one should implement dummy placeholder for - * BIO_s_fd here... + * Dummy placeholder for BIO_s_fd... */ +BIO *BIO_new_fd(int fd,int close_flag) + { + return NULL; + } +int BIO_fd_non_fatal_error(int err) + { + return 0; + } +int BIO_fd_should_retry(int i) + { + return 0; + } + +BIO_METHOD *BIO_s_fd(void) + { + return NULL; + } #else /* * As for unconditional usage of "UPLINK" interface in this module. diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 680dd0a78c95639d2f2606a0837bdbb18e39bb9b..2903bac2a8b87fc6c965ef0eb4767efaf3a13069 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -935,7 +935,9 @@ void OpenSSLDie(const char *file,int line,const char *assertion) abort(); #else /* Win32 abort() customarily shows a dialog, but we just did that... */ +#if !defined(_WIN32_WCE) raise(SIGABRT); +#endif _exit(3); #endif } diff --git a/crypto/o_str.c b/crypto/o_str.c index 56104a6c34ba9c1db5cd9ef7a0d904dcc75653b0..60c01c10a40667c29e35395ce65bef12523400d6 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -61,7 +61,7 @@ #include "o_str.h" #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \ - !defined(OPENSSL_SYSNAME_WIN32) && \ + !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && \ !defined(NETWARE_CLIB) # include #endif diff --git a/e_os.h b/e_os.h index c965541a5687288a16eaffad3acd8198333ef4d4..3688c4e0f9e2ce64fea57ec712b477db4fcb9991 100644 --- a/e_os.h +++ b/e_os.h @@ -270,7 +270,7 @@ extern "C" { */ # define _WIN32_WINNT 0x0400 # endif -# if !defined(OPENSSL_NO_SOCK) && defined(_WIN32_WINNT) +# if !defined(OPENSSL_NO_SOCK) && (defined(_WIN32_WINNT) || defined(_WIN32_WCE)) /* * Just like defining _WIN32_WINNT including winsock2.h implies * certain "discipline" for maintaining [broad] binary compatibility. @@ -286,6 +286,9 @@ extern "C" { # include # include # include +# if defined(_WIN32_WCE) && !defined(EACCES) +# define EACCES 13 +# endif # include # ifdef _WIN64 # define strlen(s) _strlen31(s) diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index d372a61bea3bbc07ce2135ba03d14d712b4801ab..2b066e01651e396715c1730ac4561db9148c362c 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -62,7 +62,7 @@ #include #include "ssl_locl.h" -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) +#if defined(OPENSSL_SYS_VMS) #include #endif @@ -481,11 +481,15 @@ int dtls1_handle_timeout(SSL *s) static void get_current_time(struct timeval *t) { -#ifdef OPENSSL_SYS_WIN32 - struct _timeb tb; - _ftime(&tb); - t->tv_sec = (long)tb.time; - t->tv_usec = (long)tb.millitm * 1000; +#if defined(_WIN32) + SYSTEMTIME st; + union { unsigned __int64 ul; FILETIME ft; } now; + + GetSystemTime(&st); + SystemTimeToFileTime(&st,&now.ft); + now.ul -= 116444736000000000UI64; /* re-bias to 1/1/1970 */ + t->tv_sec = (long)(now.ul/10000000); + t->tv_usec = ((int)(now.ul%10000000))/10; #elif defined(OPENSSL_SYS_VMS) struct timeb tb; ftime(&tb); diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl index f3fe3242ca3d02340c0f23d5b3c31fe35507cdc4..e44ad6171a64633f0d2b24c440cd3b1dcde4034d 100644 --- a/util/pl/VC-32.pl +++ b/util/pl/VC-32.pl @@ -116,7 +116,7 @@ elsif ($FLAVOR =~ /CE/) $base_cflags.=" $wcecdefs"; $base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'})); $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'})); - if (`cl 2>&1` =~ /Version 1[4-9]\./) { + if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) { $base_cflags.=($shlib and !$fipscanisterbuild)?' /MD':' /MT'; } else { $base_cflags.=' /MC';