Improve WINCE support.
authorAndy Polyakov <appro@openssl.org>
Sat, 19 Jan 2013 20:23:13 +0000 (21:23 +0100)
committerAndy Polyakov <appro@openssl.org>
Sat, 19 Jan 2013 20:23:13 +0000 (21:23 +0100)
Submitted by: Pierre Delaage

apps/apps.c
apps/apps.h
crypto/bio/bss_dgram.c
crypto/bio/bss_fd.c
crypto/cryptlib.c
crypto/o_str.c
e_os.h
ssl/d1_lib.c
util/pl/VC-32.pl

index 15f2069c95c694f4877d6ec3efcd12281be6d286..e35f3c458c1f361eb66ba76d176db3264e61833d 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB)
+#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
 #include <strings.h>
 #endif
 #include <sys/types.h>
index 6a71b8323a1a9b2a39ebd39a773c59597dfabea5..390a58c67ca09f5fa34eae37817e6e1207887e24 100644 (file)
@@ -202,7 +202,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)
index d121386a52abd9ea9109e27c1faee4cda6efe35d..f8215f440dcca926c2453d9c110a51cfbbf4ebd6 100644 (file)
@@ -66,7 +66,7 @@
 #include <openssl/bio.h>
 #ifndef OPENSSL_NO_DGRAM
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
+#if defined(OPENSSL_SYS_VMS)
 #include <sys/timeb.h>
 #endif
 
@@ -1895,7 +1895,7 @@ int BIO_dgram_non_fatal_error(int err)
 
 static void get_current_time(struct timeval *t)
        {
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
+#if defined(_WIN32)
        SYSTEMTIME st;
        union { unsigned __int64 ul; FILETIME ft; } now;
 
index d1bf85aae1750a0307b821e8b05f4b314693faa0..c274877c13086226b8114e0cde5b88d048217db9 100644 (file)
 
 #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.
index 14453491deb15daff06b65b9f1aed93940869788..07b0a66217645feedeeab008c95b5b8c428db0c1 100644 (file)
@@ -387,7 +387,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
        }
index 56104a6c34ba9c1db5cd9ef7a0d904dcc75653b0..60c01c10a40667c29e35395ce65bef12523400d6 100644 (file)
@@ -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 <strings.h>
 #endif
diff --git a/e_os.h b/e_os.h
index eaff717b2b4257dabf97bbee11d503a2dd43fd7a..364eb3778b8c73354c089e44dcd19316256b60ee 100644 (file)
--- 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 <stdio.h>
 #    include <stddef.h>
 #    include <errno.h>
+#    if defined(_WIN32_WCE) && !defined(EACCES)
+#      define EACCES   13
+#    endif
 #    include <string.h>
 #    ifdef _WIN64
 #      define strlen(s) _strlen31(s)
index 048ce3b4b088a76e9a9cec43d5cb4a476f8e19ba..db180f2ce239b24d6e8dcc99443615682b22eaef 100644 (file)
@@ -62,7 +62,7 @@
 #include <openssl/objects.h>
 #include "ssl_locl.h"
 
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
+#if defined(OPENSSL_SYS_VMS)
 #include <sys/timeb.h>
 #endif
 
@@ -452,7 +452,7 @@ int dtls1_handle_timeout(SSL *s)
 
 static void get_current_time(struct timeval *t)
 {
-#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
+#if defined(_WIN32)
        SYSTEMTIME st;
        union { unsigned __int64 ul; FILETIME ft; } now;
 
index 0aeabcf5c7befc0ecd00917580617be0669a78a8..f9749e4c787865c1d2eeee628090b1ab4fa9509d 100644 (file)
@@ -126,7 +126,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 ($cc =~ /\bcl(\.exe)*$/) {
+    if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) {
        $base_cflags.=($shlib and !$fipscanisterbuild)?' /MD':' /MT';
     } else {
        $base_cflags.=' /MC';