From 5b4ee475aa00bb30675e819a0096209e5e427668 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 20 Jun 2014 09:49:36 -0400 Subject: 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. --- src/common/compat.c | 9 --------- src/common/compat.h | 15 --------------- src/common/tortls.c | 4 ---- src/common/util.c | 2 +- src/or/main.c | 50 -------------------------------------------------- src/or/ntmain.h | 2 -- src/test/test_config.c | 10 +++++----- src/win32/orconfig.h | 9 +-------- 8 files changed, 7 insertions(+), 94 deletions(-) (limited to 'src') diff --git a/src/common/compat.c b/src/common/compat.c index e25ecc462..6fb9c210e 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -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); diff --git a/src/common/compat.h b/src/common/compat.h index ec7d2415e..635e427f0 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -56,21 +56,6 @@ #include #include -#if defined (WINCE) -#include -#include -#include -#include -/* 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 diff --git a/src/common/tortls.c b/src/common/tortls.c index ea0f21cb2..e06a2ae94 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -16,10 +16,6 @@ #include "orconfig.h" -#if defined (WINCE) -#include -#endif - #include #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include "*/ #ifndef _WIN32_WINNT diff --git a/src/common/util.c b/src/common/util.c index 2d7893b38..8589344db 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -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); diff --git a/src/or/main.c b/src/or/main.c index 1c49ba148..8ba4fef1f 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -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. diff --git a/src/or/ntmain.h b/src/or/ntmain.h index d3027936c..d09a413ae 100644 --- a/src/or/ntmain.h +++ b/src/or/ntmain.h @@ -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); diff --git a/src/test/test_config.c b/src/test/test_config.c index 94ac4dca1..b35984f76 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -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); diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h index 2f1a53c86..d12d6676e 100644 --- a/src/win32/orconfig.h +++ b/src/win32/orconfig.h @@ -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 -- cgit v1.2.3