Skip to content

Commit

Permalink
Improve WINCE support.
Browse files Browse the repository at this point in the history
Submitted by: Pierre Delaage
  • Loading branch information
Andy Polyakov committed Jan 19, 2013
1 parent 0e5cf7b commit a006fef
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
#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>
Expand Down
2 changes: 1 addition & 1 deletion apps/apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crypto/bio/bss_dgram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;

Expand Down
20 changes: 18 additions & 2 deletions crypto/bio/bss_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions crypto/cryptlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/o_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion e_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ssl/d1_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion util/pl/VC-32.pl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
$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';
Expand Down

0 comments on commit a006fef

Please sign in to comment.