mirror of https://github.com/openssl/openssl.git
				
				
				
			Improve WINCE support.
Submitted by: Pierre Delaage
(cherry picked from commit a006fef78e)
Resolved conflicts:
	crypto/bio/bss_dgram.c
	ssl/d1_lib.c
	util/pl/VC-32.pl
			
			
This commit is contained in:
		
							parent
							
								
									d451ece4e7
								
							
						
					
					
						commit
						2cc5142fb1
					
				| 
						 | 
					@ -118,7 +118,7 @@
 | 
				
			||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.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>
 | 
					#include <strings.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#include <sys/types.h>
 | 
					#include <sys/types.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -204,7 +204,7 @@ extern BIO *bio_err;
 | 
				
			||||||
#  endif
 | 
					#  endif
 | 
				
			||||||
#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)
 | 
					#  define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#  define openssl_fdset(a,b) FD_SET(a, b)
 | 
					#  define openssl_fdset(a,b) FD_SET(a, b)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -66,7 +66,7 @@
 | 
				
			||||||
#include <openssl/bio.h>
 | 
					#include <openssl/bio.h>
 | 
				
			||||||
#ifndef OPENSSL_NO_DGRAM
 | 
					#ifndef OPENSSL_NO_DGRAM
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
 | 
					#if defined(OPENSSL_SYS_VMS)
 | 
				
			||||||
#include <sys/timeb.h>
 | 
					#include <sys/timeb.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1895,11 +1895,15 @@ int BIO_dgram_non_fatal_error(int err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void get_current_time(struct timeval *t)
 | 
					static void get_current_time(struct timeval *t)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
#ifdef OPENSSL_SYS_WIN32
 | 
					#if defined(_WIN32)
 | 
				
			||||||
	struct _timeb tb;
 | 
						SYSTEMTIME st;
 | 
				
			||||||
	_ftime(&tb);
 | 
						union { unsigned __int64 ul; FILETIME ft; } now;
 | 
				
			||||||
	t->tv_sec = (long)tb.time;
 | 
					
 | 
				
			||||||
	t->tv_usec = (long)tb.millitm * 1000;
 | 
						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)
 | 
					#elif defined(OPENSSL_SYS_VMS)
 | 
				
			||||||
	struct timeb tb;
 | 
						struct timeb tb;
 | 
				
			||||||
	ftime(&tb);
 | 
						ftime(&tb);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,9 +63,25 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OPENSSL_NO_POSIX_IO)
 | 
					#if defined(OPENSSL_NO_POSIX_IO)
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * One can argue that one should implement dummy placeholder for
 | 
					 * Dummy placeholder for BIO_s_fd...
 | 
				
			||||||
 * BIO_s_fd here...
 | 
					 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					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
 | 
					#else
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * As for unconditional usage of "UPLINK" interface in this module.
 | 
					 * As for unconditional usage of "UPLINK" interface in this module.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -935,7 +935,9 @@ void OpenSSLDie(const char *file,int line,const char *assertion)
 | 
				
			||||||
	abort();
 | 
						abort();
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	/* Win32 abort() customarily shows a dialog, but we just did that... */
 | 
						/* Win32 abort() customarily shows a dialog, but we just did that... */
 | 
				
			||||||
 | 
					#if !defined(_WIN32_WCE)
 | 
				
			||||||
	raise(SIGABRT);
 | 
						raise(SIGABRT);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	_exit(3);
 | 
						_exit(3);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,7 +61,7 @@
 | 
				
			||||||
#include "o_str.h"
 | 
					#include "o_str.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
 | 
					#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
 | 
				
			||||||
    !defined(OPENSSL_SYSNAME_WIN32) && \
 | 
					    !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && \
 | 
				
			||||||
    !defined(NETWARE_CLIB)
 | 
					    !defined(NETWARE_CLIB)
 | 
				
			||||||
# include <strings.h>
 | 
					# include <strings.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										5
									
								
								e_os.h
								
								
								
								
							
							
						
						
									
										5
									
								
								e_os.h
								
								
								
								
							| 
						 | 
					@ -270,7 +270,7 @@ extern "C" {
 | 
				
			||||||
	*/
 | 
						*/
 | 
				
			||||||
#      define _WIN32_WINNT 0x0400
 | 
					#      define _WIN32_WINNT 0x0400
 | 
				
			||||||
#    endif
 | 
					#    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
 | 
					        * Just like defining _WIN32_WINNT including winsock2.h implies
 | 
				
			||||||
        * certain "discipline" for maintaining [broad] binary compatibility.
 | 
					        * certain "discipline" for maintaining [broad] binary compatibility.
 | 
				
			||||||
| 
						 | 
					@ -286,6 +286,9 @@ extern "C" {
 | 
				
			||||||
#    include <stdio.h>
 | 
					#    include <stdio.h>
 | 
				
			||||||
#    include <stddef.h>
 | 
					#    include <stddef.h>
 | 
				
			||||||
#    include <errno.h>
 | 
					#    include <errno.h>
 | 
				
			||||||
 | 
					#    if defined(_WIN32_WCE) && !defined(EACCES)
 | 
				
			||||||
 | 
					#      define EACCES   13
 | 
				
			||||||
 | 
					#    endif
 | 
				
			||||||
#    include <string.h>
 | 
					#    include <string.h>
 | 
				
			||||||
#    ifdef _WIN64
 | 
					#    ifdef _WIN64
 | 
				
			||||||
#      define strlen(s) _strlen31(s)
 | 
					#      define strlen(s) _strlen31(s)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										16
									
								
								ssl/d1_lib.c
								
								
								
								
							
							
						
						
									
										16
									
								
								ssl/d1_lib.c
								
								
								
								
							| 
						 | 
					@ -62,7 +62,7 @@
 | 
				
			||||||
#include <openssl/objects.h>
 | 
					#include <openssl/objects.h>
 | 
				
			||||||
#include "ssl_locl.h"
 | 
					#include "ssl_locl.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
 | 
					#if defined(OPENSSL_SYS_VMS)
 | 
				
			||||||
#include <sys/timeb.h>
 | 
					#include <sys/timeb.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -481,11 +481,15 @@ int dtls1_handle_timeout(SSL *s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void get_current_time(struct timeval *t)
 | 
					static void get_current_time(struct timeval *t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#ifdef OPENSSL_SYS_WIN32
 | 
					#if defined(_WIN32)
 | 
				
			||||||
	struct _timeb tb;
 | 
						SYSTEMTIME st;
 | 
				
			||||||
	_ftime(&tb);
 | 
						union { unsigned __int64 ul; FILETIME ft; } now;
 | 
				
			||||||
	t->tv_sec = (long)tb.time;
 | 
					
 | 
				
			||||||
	t->tv_usec = (long)tb.millitm * 1000;
 | 
						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)
 | 
					#elif defined(OPENSSL_SYS_VMS)
 | 
				
			||||||
	struct timeb tb;
 | 
						struct timeb tb;
 | 
				
			||||||
	ftime(&tb);
 | 
						ftime(&tb);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,7 +116,7 @@ elsif ($FLAVOR =~ /CE/)
 | 
				
			||||||
    $base_cflags.=" $wcecdefs";
 | 
					    $base_cflags.=" $wcecdefs";
 | 
				
			||||||
    $base_cflags.=' -I$(WCECOMPAT)/include'		if (defined($ENV{'WCECOMPAT'}));
 | 
					    $base_cflags.=' -I$(WCECOMPAT)/include'		if (defined($ENV{'WCECOMPAT'}));
 | 
				
			||||||
    $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include'	if (defined($ENV{'PORTSDK_LIBPATH'}));
 | 
					    $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';
 | 
						$base_cflags.=($shlib and !$fipscanisterbuild)?' /MD':' /MT';
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
	$base_cflags.=' /MC';
 | 
						$base_cflags.=' /MC';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue