Remove code for Windows CE support

As far as I know, nobody has used this in ages.  It would be a
pretty big surprise if it had worked.

Closes ticket 11446.
This commit is contained in:
Nick Mathewson 2014-06-20 09:49:36 -04:00
parent 456184c2a0
commit 5b4ee475aa
9 changed files with 11 additions and 94 deletions

4
changes/no-wince Normal file
View File

@ -0,0 +1,4 @@
o Removed platform support:
- We no longer include special code to build on Windows CE; as far
as we know, nobody has used Tor on Windows CE in a very long
time. Closes ticket 11446.

View File

@ -2485,14 +2485,12 @@ get_uname(void)
"Unrecognized version of Windows [major=%d,minor=%d]",
(int)info.dwMajorVersion,(int)info.dwMinorVersion);
}
#if !defined (WINCE)
#ifdef VER_NT_SERVER
if (info.wProductType == VER_NT_SERVER ||
info.wProductType == VER_NT_DOMAIN_CONTROLLER) {
strlcat(uname_result, " [server]", sizeof(uname_result));
}
#endif
#endif
#else
strlcpy(uname_result, "Unknown platform", sizeof(uname_result));
#endif
@ -2697,15 +2695,8 @@ tor_gettimeofday(struct timeval *timeval)
uint64_t ft_64;
FILETIME ft_ft;
} ft;
#if defined (WINCE)
/* wince do not have GetSystemTimeAsFileTime */
SYSTEMTIME stime;
GetSystemTime(&stime);
SystemTimeToFileTime(&stime,&ft.ft_ft);
#else
/* number of 100-nsec units since Jan 1, 1601 */
GetSystemTimeAsFileTime(&ft.ft_ft);
#endif
if (ft.ft_64 < EPOCH_BIAS) {
log_err(LD_GENERAL,"System time is before 1970; failing.");
exit(1);

View File

@ -56,21 +56,6 @@
#include <stdio.h>
#include <errno.h>
#if defined (WINCE)
#include <fcntl.h>
#include <io.h>
#include <math.h>
#include <projects.h>
/* this is not exported as W .... */
#define SHGetPathFromIDListW SHGetPathFromIDList
/* wcecompat has vasprintf */
#define HAVE_VASPRINTF
/* no service here */
#ifdef NT_SERVICE
#undef NT_SERVICE
#endif
#endif // WINCE
#ifndef NULL_REP_IS_ZERO_BYTES
#error "It seems your platform does not represent NULL as zero. We can't cope."
#endif

View File

@ -16,10 +16,6 @@
#include "orconfig.h"
#if defined (WINCE)
#include <WinSock2.h>
#endif
#include <assert.h>
#ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
#ifndef _WIN32_WINNT

View File

@ -1893,7 +1893,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
}
if (check & CPD_CREATE) {
log_info(LD_GENERAL, "Creating directory %s", dirname);
#if defined (_WIN32) && !defined (WINCE)
#if defined (_WIN32)
r = mkdir(dirname);
#else
r = mkdir(dirname, 0700);

View File

@ -2706,31 +2706,6 @@ do_dump_config(void)
return 0;
}
#if defined (WINCE)
int
find_flashcard_path(PWCHAR path, size_t size)
{
WIN32_FIND_DATA d = {0};
HANDLE h = NULL;
if (!path)
return -1;
h = FindFirstFlashCard(&d);
if (h == INVALID_HANDLE_VALUE)
return -1;
if (wcslen(d.cFileName) == 0) {
FindClose(h);
return -1;
}
wcsncpy(path,d.cFileName,size);
FindClose(h);
return 0;
}
#endif
static void
init_addrinfo(void)
{
@ -2959,31 +2934,6 @@ int
tor_main(int argc, char *argv[])
{
int result = 0;
#if defined (WINCE)
WCHAR path [MAX_PATH] = {0};
WCHAR fullpath [MAX_PATH] = {0};
PWCHAR p = NULL;
FILE* redir = NULL;
FILE* redirdbg = NULL;
// this is to facilitate debugging by opening
// a file on a folder shared by the wm emulator.
// if no flashcard (real or emulated) is present,
// log files will be written in the root folder
if (find_flashcard_path(path,MAX_PATH) == -1) {
redir = _wfreopen( L"\\stdout.log", L"w", stdout );
redirdbg = _wfreopen( L"\\stderr.log", L"w", stderr );
} else {
swprintf(fullpath,L"\\%s\\tor",path);
CreateDirectory(fullpath,NULL);
swprintf(fullpath,L"\\%s\\tor\\stdout.log",path);
redir = _wfreopen( fullpath, L"w", stdout );
swprintf(fullpath,L"\\%s\\tor\\stderr.log",path);
redirdbg = _wfreopen( fullpath, L"w", stderr );
}
#endif
#ifdef _WIN32
/* Call SetProcessDEPPolicy to permanently enable DEP.

View File

@ -13,10 +13,8 @@
#define TOR_NTMAIN_H
#ifdef _WIN32
#if !defined (WINCE)
#define NT_SERVICE
#endif
#endif
#ifdef NT_SERVICE
int nt_service_parse_options(int argc, char **argv, int *should_exit);

View File

@ -184,7 +184,7 @@ is_private_dir(const char* path)
if (r) {
return 0;
}
#if !defined (_WIN32) || defined (WINCE)
#if !defined (_WIN32)
if ((st.st_mode & (S_IFDIR | 0777)) != (S_IFDIR | 0700)) {
return 0;
}
@ -201,7 +201,7 @@ test_config_check_or_create_data_subdir(void *arg)
char *subpath;
struct stat st;
int r;
#if !defined (_WIN32) || defined (WINCE)
#if !defined (_WIN32)
unsigned group_permission;
#endif
(void)arg;
@ -210,7 +210,7 @@ test_config_check_or_create_data_subdir(void *arg)
datadir = options->DataDirectory = tor_strdup(get_fname("datadir-0"));
subpath = get_datadir_fname(subdir);
#if defined (_WIN32) && !defined (WINCE)
#if defined (_WIN32)
tt_int_op(mkdir(options->DataDirectory), ==, 0);
#else
tt_int_op(mkdir(options->DataDirectory, 0700), ==, 0);
@ -233,7 +233,7 @@ test_config_check_or_create_data_subdir(void *arg)
tt_abort_perror("stat");
}
#if !defined (_WIN32) || defined (WINCE)
#if !defined (_WIN32)
group_permission = st.st_mode | 0070;
r = chmod(subpath, group_permission);
@ -284,7 +284,7 @@ test_config_write_to_data_subdir(void *arg)
datadir = options->DataDirectory = tor_strdup(get_fname("datadir-1"));
filepath = get_datadir_fname2(subdir, fname);
#if defined (_WIN32) && !defined (WINCE)
#if defined (_WIN32)
tt_int_op(mkdir(options->DataDirectory), ==, 0);
#else
tt_int_op(mkdir(options->DataDirectory, 0700), ==, 0);

View File

@ -86,18 +86,11 @@
#define HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#if defined (WINCE)
#define HAVE_STRLCAT
#else
#undef HAVE_STRLCAT
#endif
/* Define to 1 if you have the `strlcpy' function. */
#if defined (WINCE)
#define HAVE_STRLCPY
#else
#undef HAVE_STRLCPY
#endif
/* Define to 1 if you have the `strptime' function. */
#undef HAVE_STRPTIME