diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 37 | ||||
-rw-r--r-- | src/estream-printf.c | 12 | ||||
-rw-r--r-- | src/estream.c | 34 | ||||
-rw-r--r-- | src/gpg-error.def.in | 4 | ||||
-rw-r--r-- | src/gpgrt-int.h | 12 | ||||
-rw-r--r-- | src/init.c | 63 | ||||
-rw-r--r-- | src/init.h | 9 | ||||
-rw-r--r-- | src/spawn-posix.c | 2 | ||||
-rw-r--r-- | src/spawn-w32.c | 2 | ||||
-rw-r--r-- | src/sysutils.c | 6 | ||||
-rw-r--r-- | src/w32-estream.c | 42 | ||||
-rw-r--r-- | src/w32-reg.c | 2 | ||||
-rw-r--r-- | src/w32ce-add.h | 8 |
13 files changed, 12 insertions, 221 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 34e0476..b8334a4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,13 +24,8 @@ # depend on the configuration anyway. # -if HAVE_W32CE_SYSTEM -gpg_extra_headers = gpg-extra/errno.h -extra_cppflags = -idirafter gpg-extra -else gpg_extra_headers = extra_cppflags = -endif localedir = $(datadir)/locale @@ -96,7 +91,7 @@ pkgconfig_DATA = gpg-error.pc EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ mkerrnos.awk errnos.in README \ mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \ - mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \ + mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h \ err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 gpgrt.m4 \ gpg-error.vers gpg-error.def.in \ versioninfo.rc.in gpg-error.w32-manifest.in \ @@ -253,20 +248,8 @@ mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers) $(AWK) -f $(srcdir)/mkerrcodes.awk >$@ -rm _$@ -if HAVE_W32CE_SYSTEM -# It is correct to use $(CPP). We want the host's idea of the error codes. -mkw32errmap.tab.h: Makefile mkw32errmap.c - $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \ - grep '{&mkw32errmap_marker' >$@ -mkw32errmap.map.c: mkw32errmap$(EXEEXT_FOR_BUILD) - ./mkw32errmap$(EXEEXT_FOR_BUILD) --map > $@ -gpg-extra/errno.h: mkw32errmap$(EXEEXT_FOR_BUILD) - -$(MKDIR_P) gpg-extra - ./mkw32errmap$(EXEEXT_FOR_BUILD) > $@ -else mkw32errmap.map.c: echo "/*dummy*/" > $@ -endif # We use CC proper for preprocessing thus we have to convince it that # the data is really to be preprocessed. @@ -282,14 +265,6 @@ mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \ $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c -if HAVE_W32CE_SYSTEM -# It is correct to use $(CC_FOR_BUILD) here. We want to run the -# program at build time. -mkw32errmap$(EXEEXT_FOR_BUILD): mkw32errmap.c mkw32errmap.tab.h Makefile - $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \ - $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c -endif - code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile ./mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@ @@ -309,7 +284,6 @@ parts_of_gpg_error_h = \ err-codes.h.in \ errnos.in \ w32-add.h \ - w32ce-add.h \ $(lock_obj_pub) # If we are cross-compiling or building on Windows we better make sure @@ -356,12 +330,3 @@ gpg-error-config: gpgrt-config gpg-error-config-old gpg-error-config-test.sh exit 1; \ fi cp gpg-error-config-old $@ - -install-data-local: -if HAVE_W32CE_SYSTEM - -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra" - $(INSTALL_DATA) gpg-extra/errno.h \ - "$(DESTDIR)$(includedir)/gpg-extra/errno.h" -else - : -endif diff --git a/src/estream-printf.c b/src/estream-printf.c index fe25657..831af55 100644 --- a/src/estream-printf.c +++ b/src/estream-printf.c @@ -77,9 +77,6 @@ #if defined(_WIN32) && !defined(HAVE_W32_SYSTEM) # define HAVE_W32_SYSTEM 1 -# if defined(__MINGW32CE__) && !defined (HAVE_W32CE_SYSTEM) -# define HAVE_W32CE_SYSTEM -# endif #endif #include <stdio.h> @@ -97,9 +94,6 @@ #ifdef HAVE_LANGINFO_THOUSEP #include <langinfo.h> #endif -#ifdef HAVE_W32CE_SYSTEM -#include <gpg-error.h> /* ERRNO replacement. */ -#endif #ifdef _ESTREAM_PRINTF_EXTRA_INCLUDE # include _ESTREAM_PRINTF_EXTRA_INCLUDE #endif @@ -116,11 +110,7 @@ #endif /* A wrapper to set ERRNO. */ -#ifdef HAVE_W32CE_SYSTEM -# define _set_errno(a) gpg_err_set_errno ((a)) -#else -# define _set_errno(a) do { errno = (a); } while (0) -#endif +#define _set_errno(a) do { errno = (a); } while (0) /* Calculate array dimension. */ diff --git a/src/estream.c b/src/estream.c index 32f8f48..07a5d97 100644 --- a/src/estream.c +++ b/src/estream.c @@ -62,9 +62,6 @@ #if defined(_WIN32) && !defined(HAVE_W32_SYSTEM) # define HAVE_W32_SYSTEM 1 -# if defined(__MINGW32CE__) && !defined (HAVE_W32CE_SYSTEM) -# define HAVE_W32CE_SYSTEM -# endif #endif #ifdef HAVE_SYS_TIME_H @@ -146,14 +143,7 @@ #endif -#ifdef HAVE_W32CE_SYSTEM -# define _set_errno(a) gpg_err_set_errno ((a)) -/* Setmode is missing in cegcc but available since CE 5.0. */ -int _setmode (int handle, int mode); -# define setmode(a,b) _setmode ((a),(b)) -#else -# define _set_errno(a) do { errno = (a); } while (0) -#endif +#define _set_errno(a) do { errno = (a); } while (0) #define IS_INVALID_FD(a) ((a) == -1) @@ -1590,9 +1580,6 @@ func_w32_seek (void *cookie, gpgrt_off_t *offset, int whence) _set_errno (EINVAL); return -1; } -#ifdef HAVE_W32CE_SYSTEM -# warning need to use SetFilePointer -#else if (!w32_cookie->no_syscall_clamp) _gpgrt_pre_syscall (); if (!SetFilePointerEx (w32_cookie->hd, distance, &newoff, method)) @@ -1603,7 +1590,6 @@ func_w32_seek (void *cookie, gpgrt_off_t *offset, int whence) } if (!w32_cookie->no_syscall_clamp) _gpgrt_post_syscall (); -#endif /* Note that gpgrt_off_t is always 64 bit. */ *offset = (gpgrt_off_t)newoff.QuadPart; return 0; @@ -5024,15 +5010,9 @@ tmpfd (void) { #ifdef HAVE_W32_SYSTEM int attempts, n; -#ifdef HAVE_W32CE_SYSTEM - wchar_t buffer[MAX_PATH+9+12+1]; -# define mystrlen(a) wcslen (a) - wchar_t *name, *p; -#else char buffer[MAX_PATH+9+12+1]; # define mystrlen(a) strlen (a) char *name, *p; -#endif HANDLE file; int pid = GetCurrentProcessId (); unsigned int value; @@ -5045,11 +5025,7 @@ tmpfd (void) return -1; } p = buffer + mystrlen (buffer); -#ifdef HAVE_W32CE_SYSTEM - wcscpy (p, L"_estream"); -#else strcpy (p, "_estream"); -#endif p += 8; /* We try to create the directory but don't care about an error as it may already exist and the CreateFile would throw an error @@ -5066,11 +5042,7 @@ tmpfd (void) *p++ = tohex (((value >> 28) & 0x0f)); value <<= 4; } -#ifdef HAVE_W32CE_SYSTEM - wcscpy (p, L".tmp"); -#else strcpy (p, ".tmp"); -#endif file = CreateFile (buffer, GENERIC_READ | GENERIC_WRITE, 0, @@ -5080,16 +5052,12 @@ tmpfd (void) NULL); if (file != INVALID_HANDLE_VALUE) { -#ifdef HAVE_W32CE_SYSTEM - int fd = (int)file; -#else int fd = _open_osfhandle ((intptr_t)file, 0); if (fd == -1) { CloseHandle (file); return -1; } -#endif return fd; } Sleep (1); /* One ms as this is the granularity of GetTickCount. */ diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in index c75b317..28e9ef3 100644 --- a/src/gpg-error.def.in +++ b/src/gpg-error.def.in @@ -34,10 +34,6 @@ EXPORTS /* @6 - Not anymore used. */ gpg_err_code_from_syserror @7 gpg_err_set_errno @8 -#ifdef HAVE_W32CE_SYSTEM - _gpg_w32ce_get_errno @9 - _gpg_w32ce_strerror @10 -#endif #ifdef HAVE_W32_SYSTEM _gpg_w32_bindtextdomain @11 _gpg_w32_textdomain @12 diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h index a541620..cb14191 100644 --- a/src/gpgrt-int.h +++ b/src/gpgrt-int.h @@ -667,14 +667,14 @@ gpg_err_code_t _gpgrt_make_pipe (int filedes[2], estream_t *r_fp, * * GPGRT_SPAWN_DETACHED * If set the process will be started as a background process. - * This flag is only useful under W32 (but not W32CE) systems, - * so that no new console is created and pops up a console - * window when starting the server. Does not work on W32CE. + * This flag is only useful under W32 systems, so that no new + * console is created and pops up a console window when starting + * the server. * * GPGRT_SPAWN_RUN_ASFW - * On W32 (but not on W32CE) run AllowSetForegroundWindow for - * the child. Note that due to unknown problems this actually - * allows SetForegroundWindow for all children of this process. + * On W32 run AllowSetForegroundWindow for the child. Note that + * due to unknown problems this actually allows + * SetForegroundWindow for all children of this process. */ gpg_err_code_t _gpgrt_spawn_process (const char *pgmname, const char *argv[], @@ -30,17 +30,6 @@ #include "gettext.h" #include "init.h" -#ifdef HAVE_W32CE_SYSTEM -# include "mkw32errmap.map.c" /* Generated map_w32codes () */ -# ifndef TLS_OUT_OF_INDEXES -# define TLS_OUT_OF_INDEXES 0xFFFFFFFF -# endif -# ifndef __MINGW32CE__ -# /* Replace the Mingw32CE provided abort function. */ -# define abort() do { TerminateProcess (GetCurrentProcess(), 8); } while (0) -# endif -#endif - /* Locale directory support. */ @@ -426,11 +415,7 @@ _gpgrt_free (void *a) void _gpg_err_set_errno (int err) { -#ifdef HAVE_W32CE_SYSTEM - SetLastError (err); -#else /*!HAVE_W32CE_SYSTEM*/ errno = err; -#endif /*!HAVE_W32CE_SYSTEM*/ } @@ -649,54 +634,6 @@ get_tls (void) } -/* Return the value of the ERRNO variable. This needs to be a - function so that we can have a per-thread ERRNO. This is used only - on WindowsCE because that OS misses an errno. */ -#ifdef HAVE_W32CE_SYSTEM -int -_gpg_w32ce_get_errno (void) -{ - return map_w32codes ( GetLastError () ); -} -#endif /*HAVE_W32CE_SYSTEM*/ - - -/* Replacement strerror function for WindowsCE. */ -#ifdef HAVE_W32CE_SYSTEM -char * -_gpg_w32ce_strerror (int err) -{ - struct tls_space_s *tls = get_tls (); - wchar_t tmpbuf[STRBUFFER_SIZE]; - int n; - - if (err == -1) - err = _gpg_w32ce_get_errno (); - - /* Note: On a German HTC Touch Pro2 device I also tried - LOCALE_USER_DEFAULT and LOCALE_SYSTEM_DEFAULT - both returned - English messages. */ - if (FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - tmpbuf, STRBUFFER_SIZE -1, - NULL)) - { - n = WideCharToMultiByte (CP_UTF8, 0, tmpbuf, -1, - tls->strerror_buffer, - sizeof tls->strerror_buffer -1, - NULL, NULL); - } - else - n = -1; - - if (n < 0) - snprintf (tls->strerror_buffer, sizeof tls->strerror_buffer -1, - "[w32err=%d]", err); - return tls->strerror_buffer; -} -#endif /*HAVE_W32CE_SYSTEM*/ - - /* Entry point called by the DLL loader. */ #ifdef DLL_EXPORT int WINAPI @@ -40,20 +40,11 @@ struct domainlist_s -/* 119 bytes for an error message should be enough. With this size we - can assume that the allocation does not take up more than 128 bytes - per thread. Note that this is only used for W32CE. */ -#define STRBUFFER_SIZE 120 - /* The TLS space definition. */ struct tls_space_s { /* Flag used by w32-gettext. */ int gt_use_utf8; - -#ifdef HAVE_W32CE_SYSTEM - char strerror_buffer[STRBUFFER_SIZE]; -#endif }; /* Return the TLS. */ diff --git a/src/spawn-posix.c b/src/spawn-posix.c index d33bade..54a6a68 100644 --- a/src/spawn-posix.c +++ b/src/spawn-posix.c @@ -23,7 +23,7 @@ #include <config.h> -#if defined(HAVE_W32_SYSTEM) || defined (HAVE_W32CE_SYSTEM) +#if defined(HAVE_W32_SYSTEM) #error This code is only used on POSIX #endif diff --git a/src/spawn-w32.c b/src/spawn-w32.c index 1b5f085..90c0538 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -23,7 +23,7 @@ #include <config.h> -#if !defined(HAVE_W32_SYSTEM) || defined (HAVE_W32CE_SYSTEM) +#if !defined(HAVE_W32_SYSTEM) #error This code is only used on W32. #endif diff --git a/src/sysutils.c b/src/sysutils.c index bc3a68d..1251ed6 100644 --- a/src/sysutils.c +++ b/src/sysutils.c @@ -436,11 +436,7 @@ _gpgrt_chdir (const char *name) char * _gpgrt_getcwd (void) { -#ifdef HAVE_W32CE_SYSTEM - - return xtrystrdup ("/"); - -#elif defined(HAVE_W32_SYSTEM) +#if defined(HAVE_W32_SYSTEM) wchar_t wbuffer[MAX_PATH + sizeof(wchar_t)]; DWORD wlen; char *buf, *p; diff --git a/src/w32-estream.c b/src/w32-estream.c index e17ea2c..06851a5 100644 --- a/src/w32-estream.c +++ b/src/w32-estream.c @@ -168,8 +168,6 @@ reader (void *arg) if (nread < 0) { ctx->error_code = (int) errno; - /* NOTE (W32CE): Do not ignore ERROR_BUSY! Check at - least stop_me if that happens. */ if (ctx->error_code == ERROR_BROKEN_PIPE) { ctx->eof = 1; @@ -268,12 +266,7 @@ create_reader (estream_cookie_w32_pollable_t pcookie) InitializeCriticalSection (&ctx->mutex); -#ifdef HAVE_W32CE_SYSTEM - ctx->thread_hd = CreateThread (&sec_attr, 64 * 1024, reader, ctx, - STACK_SIZE_PARAM_IS_A_RESERVATION, &tid); -#else ctx->thread_hd = CreateThread (&sec_attr, 0, reader, ctx, 0, &tid); -#endif if (!ctx->thread_hd) { @@ -314,22 +307,6 @@ destroy_reader (struct reader_context_s *ctx) SetEvent (ctx->have_space_ev); LeaveCriticalSection (&ctx->mutex); -#ifdef HAVE_W32CE_SYSTEM - /* Scenario: We never create a full pipe, but already started - reading. Then we need to unblock the reader in the pipe driver - to make our reader thread notice that we want it to go away. */ - - if (ctx->file_hd != INVALID_HANDLE_VALUE) - { - if (!DeviceIoControl (ctx->file_hd, GPGCEDEV_IOCTL_UNBLOCK, - NULL, 0, NULL, 0, NULL, NULL)) - { - trace (("%p: unblock control call failed: ec=%d", - ctx, (int)GetLastError ())); - } - } -#endif - /* XXX is it feasible to unblock the thread? */ /* After setting this event CTX is void. */ @@ -571,12 +548,7 @@ create_writer (estream_cookie_w32_pollable_t pcookie) InitializeCriticalSection (&ctx->mutex); -#ifdef HAVE_W32CE_SYSTEM - ctx->thread_hd = CreateThread (&sec_attr, 64 * 1024, writer, ctx, - STACK_SIZE_PARAM_IS_A_RESERVATION, &tid); -#else ctx->thread_hd = CreateThread (&sec_attr, 0, writer, ctx, 0, &tid ); -#endif if (!ctx->thread_hd) { @@ -621,20 +593,6 @@ destroy_writer (struct writer_context_s *ctx) /* Give the writer a chance to flush the buffer. */ WaitForSingleObject (ctx->is_empty, INFINITE); -#ifdef HAVE_W32CE_SYSTEM - /* Scenario: We never create a full pipe, but already started - writing more than the pipe buffer. Then we need to unblock the - writer in the pipe driver to make our writer thread notice that - we want it to go away. */ - - if (!DeviceIoControl (ctx->file_hd, GPGCEDEV_IOCTL_UNBLOCK, - NULL, 0, NULL, 0, NULL, NULL)) - { - trace (("%p: unblock control call failed: ec=%d", - ctx, (int)GetLastError ())); - } -#endif - /* After setting this event CTX is void. */ trace (("%p: set close_ev", ctx)); SetEvent (ctx->close_ev); diff --git a/src/w32-reg.c b/src/w32-reg.c index d1d2ca6..5510df8 100644 --- a/src/w32-reg.c +++ b/src/w32-reg.c @@ -102,7 +102,6 @@ _gpgrt_w32_reg_query_string (const char *root, const char *dir, } result[nbytes] = 0; /* Make sure it is really a string. */ -#ifndef HAVE_W32CE_SYSTEM /* (Windows CE has no environment.) */ if (type == REG_EXPAND_SZ && strchr (result, '%')) { char *tmp; @@ -146,7 +145,6 @@ _gpgrt_w32_reg_query_string (const char *root, const char *dir, xfree (tmp); } } -#endif leave: RegCloseKey (key_handle); diff --git a/src/w32ce-add.h b/src/w32ce-add.h deleted file mode 100644 index c6207bb..0000000 --- a/src/w32ce-add.h +++ /dev/null @@ -1,8 +0,0 @@ -## w32ce-add.h - Snippet to be be included into gpg-error.h. -## (Comments are indicated by a double hash mark) - -/* Substitute for strerror - this one is thread safe. */ -char *_gpg_w32ce_strerror (int err); -#ifdef GPG_ERR_ENABLE_ERRNO_MACROS -# define strerror(a) _gpg_w32ce_strerror (a) -#endif |