summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-06-28 12:05:04 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-06-28 12:05:04 +0900
commit14ead267268f8ed14bf1ab49189646a95654b706 (patch)
tree19424bb2bacde3198c0f139e2d42c8c2225cac16 /src
parent084d135f44a027e86f1005c893935464ffbc4b82 (diff)
downloadlibgpg-error-14ead267268f8ed14bf1ab49189646a95654b706.tar.gz
Remove Windows CE support.
* contrib/*: Remove. * Makefile.am: Remove contrib. * autogen.sh: Remove Windows CE support. * configure.ac (have_w32ce_system): Remove. * src/Makefile.am [HAVE_W32CE_SYSTEM] (extra_cppflags): Remove. (gpg_extra_headers): Remove. (EXTRA_DIST): Remove mkw32errmap.c and w32ce-add.h (BUILT_SOURCES): Remove mkw32errmap.map.c. (tmp_files): Remove mkw32errmap.tab.h mkw32errmap.map.c (CLEANFILES): Likewise. * src/estream-printf.c [HAVE_W32CE_SYSTEM]: Remove. * src/estream.c [HAVE_W32CE_SYSTEM]: Remove. * src/gpg-error.def.in [HAVE_W32CE_SYSTEM]: Remove. * src/gpgrt-int.h: Fix comment. * src/init.c [HAVE_W32CE_SYSTEM]: Remove. * src/init.h [HAVE_W32CE_SYSTEM]: Remove. * src/mkheader.c: Remove Windows CE support. * src/mkw32errmap.c, src/w32ce-add.h: Remove. * src/spawn-posix.c [HAVE_W32CE_SYSTEM]: Remove. * src/spawn-w32.c [HAVE_W32CE_SYSTEM]: Remove. * src/sysutils.c [HAVE_W32CE_SYSTEM]: Remove. * src/w32-estream.c [HAVE_W32CE_SYSTEM]: Remove. * src/w32-reg.c [HAVE_W32CE_SYSTEM]: Remove. * tests/Makefile.am [HAVE_W32CE_SYSTEM]: Remove. -- GnuPG-bug-id: 5912 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am66
-rw-r--r--src/estream-printf.c12
-rw-r--r--src/estream.c34
-rw-r--r--src/gpg-error.def.in4
-rw-r--r--src/gpgrt-int.h12
-rw-r--r--src/init.c63
-rw-r--r--src/init.h9
-rw-r--r--src/mkheader.c5
-rw-r--r--src/mkw32errmap.c178
-rw-r--r--src/spawn-posix.c2
-rw-r--r--src/spawn-w32.c2
-rw-r--r--src/sysutils.c6
-rw-r--r--src/w32-estream.c42
-rw-r--r--src/w32-reg.c2
-rw-r--r--src/w32ce-add.h8
15 files changed, 22 insertions, 423 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 34e0476..ded4f0b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,14 +24,6 @@
# 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
bin_PROGRAMS = gpg-error
@@ -96,7 +88,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 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 \
@@ -106,14 +98,14 @@ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
BUILT_SOURCES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h \
code-to-errno.h code-from-errno.h \
err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h gpgrt.h \
- gpg-error.def mkw32errmap.map.c
+ gpg-error.def
-tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c
+tmp_files = _mkerrcodes.h _gpg-error.def.h
CLEANFILES = code-to-errno.h code-from-errno.h \
gpg-error.h gpgrt.h \
- mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
- mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
+ mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def \
+ err-sources-sym.h err-codes-sym.h errnos-sym.h \
gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \
gpgrt-config gpg-error-config-old gpg-error-config-test.sh \
gpg-error-config gpg-error-config-test.log \
@@ -130,7 +122,7 @@ if HAVE_W32_SYSTEM
arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \
w32-iconv.c w32-estream.c w32-reg.c spawn-w32.c
RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS)
+ $(libgpg_error_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
SUFFIXES = .rc .lo
@@ -211,15 +203,12 @@ nodist_libgpg_error_la_SOURCES = gpg-error.h
# libgpg_error_la_DEPENDENCIES = \
# $(srcdir)/gpg-error.vers
-# Note that RCCOMPILE needs the same defines as ..._la_CPPFLAGS but
-# without the extra_cppflags because they may include am -idirafter
-# which is not supported by the RC compiler.
-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
+libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD)
gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
- -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
+ -DLOCALEDIR=\"$(localedir)\"
gpg_error_LDADD = libgpg-error.la $(LTLIBINTL)
# We build err-sources.h and err-codes.h in the source directory.
@@ -247,32 +236,17 @@ code-to-errno.h: Makefile mkerrnos.awk errnos.in
$(AWK) -f $(srcdir)/mkerrnos.awk $(srcdir)/errnos.in >$@
# It is correct to use $(CPP). We want the host's idea of the error codes.
-mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers)
+mkerrcodes.h: Makefile mkerrcodes.awk
$(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@
- $(CPP) $(CPPFLAGS) $(extra_cppflags) -P _$@ | grep GPG_ERR_ | \
+ $(CPP) $(CPPFLAGS) -P _$@ | grep GPG_ERR_ | \
$(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.
gpg-error.def: Makefile gpg-error.def.in
cat $(srcdir)/gpg-error.def.in >_$@.h
- $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) $(extra_cppflags) _$@.h | \
+ $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) _$@.h | \
grep -v '^#' >$@
-rm _$@.h
@@ -282,14 +256,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 +275,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 +321,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[],
diff --git a/src/init.c b/src/init.c
index 2d9f7ab..493e3ba 100644
--- a/src/init.c
+++ b/src/init.c
@@ -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
diff --git a/src/init.h b/src/init.h
index 90a716a..ea7154d 100644
--- a/src/init.h
+++ b/src/init.h
@@ -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/mkheader.c b/src/mkheader.c
index 154d79f..e05dafd 100644
--- a/src/mkheader.c
+++ b/src/mkheader.c
@@ -614,11 +614,6 @@ write_special (const char *fname, int lnr, const char *tag)
{
include_file (fname, lnr, "w32-add.h", write_line);
}
- else if (!strcmp (host_os, "mingw32ce"))
- {
- include_file (fname, lnr, "w32-add.h", write_line);
- include_file (fname, lnr, "w32ce-add.h", write_line);
- }
}
else if (!strcmp (tag, "include:lock-obj"))
{
diff --git a/src/mkw32errmap.c b/src/mkw32errmap.c
deleted file mode 100644
index 508a513..0000000
--- a/src/mkw32errmap.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* mkw32errmap.c - Generate mapping sources for Windows.
- Copyright (C) 2010 g10 Code GmbH
-
- This file is part of libgpg-error.
-
- libgpg-error is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License
- as published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- libgpg-error is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this program; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#ifdef RESOLVE_MACROS
-# include <winerror.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-static const char header_gpg_extra_errno_h[] =
- "/* errno.h - WindowsCE errno.h substitute\n"
- " Copyright (C) 2010 g10 Code GmbH\n"
- "\n"
- " This file is free software; as a special exception the author gives\n"
- " unlimited permission to copy and/or distribute it, with or without\n"
- " modifications, as long as this notice is preserved.\n"
- "\n"
- " This file is distributed in the hope that it will be useful, but\n"
- " WITHOUT ANY WARRANTY, to the extent permitted by law; without even\n"
- " the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
- " PURPOSE.\n"
- "\n"
- " +++ Do not edit! File has been generated by mkw32errmap.c +++\n"
- "\n"
- " This file is intended to be used with ming32ce-gcc to implement an\n"
- " errno substitute under WindowsCE. It must be included via gcc's\n"
- " -idirafter option. The gpg-error-config script emits the\n"
- " appropriate option snippet. The actual implementation of the errno\n"
- " related functions are part of libgpg-error. A separate header file\n"
- " is required because errno.h is often included before gpg-error.h.\n"
- " */\n"
- "\n"
- "#ifndef _GPG_ERROR_EXTRA_ERRNO_H\n"
- "#define _GPG_ERROR_EXTRA_ERRNO_H\n"
- "\n"
- "/* Due to peculiarities in W32 we can't implement ERRNO as an\n"
- " writable lvalue. This also allows us to easily find places\n"
- " where ERRNO is being written to. See also gpg_err_set_errno. */\n"
- "int _gpg_w32ce_get_errno (void);\n"
- "#define errno (_gpg_w32ce_get_errno ())\n"
- "\n";
-static const char footer_gpg_extra_errno_h[] =
- "\n"
- "#endif /*_GPG_ERROR_EXTRA_ERRNO_H*/\n";
-
-
-/* The table below is used in two modes. First we run the host
- preprocessor over it to generate a new include file. This include
- file has the same content but the Windows error macros are
- resolved. This is so that we don't need to include winerror.h into
- the generated errno.h. The mkw32errmap_marker variable is only
- here to have something to grep for after preprocessing. */
-static int mkw32errmap_marker;
-struct table_s
-{
- int *dummy;
- const char *name;
- int w32code;
- int w32code2;
-};
-
-struct table_s table[] =
- {
-#ifdef RESOLVE_MACROS
-#define X(a,b,c) \
- {&mkw32errmap_marker, (a), (b), (c)}
- X( "EPERM", ERROR_CANNOT_MAKE , 0 ),
- X( "ENOENT", ERROR_FILE_NOT_FOUND , ERROR_PATH_NOT_FOUND ),
- X( "EINTR", ERROR_INVALID_AT_INTERRUPT_TIME , 0 ),
- X( "EIO", ERROR_IO_DEVICE , 0 ),
- X( "ENXIO", ERROR_FILE_INVALID , 0 ),
- X( "EBADF", ERROR_INVALID_HANDLE , 0 ),
- X( "EAGAIN", ERROR_MORE_DATA , WSAEWOULDBLOCK ),
-
- X( "ENOMEM", ERROR_NOT_ENOUGH_MEMORY , 0 ),
- X( "EACCES", ERROR_ACCESS_DENIED , 0 ),
- X( "EFAULT", ERROR_PROCESS_ABORTED , 0 ),
- X( "EBUSY", ERROR_BUSY , 0 ),
- X( "EEXIST", ERROR_FILE_EXISTS , WSAEADDRINUSE ),
-
- X( "EXDEV", ERROR_NOT_SAME_DEVICE , 0 ),
- X( "ENODEV", ERROR_BAD_DEVICE , ERROR_DEV_NOT_EXIST ),
-
- X( "ENOTDIR",ERROR_DIRECTORY , 0 ),
- X( "EINVAL", ERROR_INVALID_PARAMETER , 0 ),
- X( "ENFILE", ERROR_NO_MORE_FILES , 0 ),
- X( "EMFILE", ERROR_TOO_MANY_OPEN_FILES , 0 ),
- X( "ENOSPC", ERROR_DISK_FULL , 0 ),
- X( "EROFS", ERROR_WRITE_PROTECT , 0 ),
- X( "EPIPE", ERROR_BROKEN_PIPE , 0 ),
- X( "ERANGE", ERROR_ARITHMETIC_OVERFLOW , 0 ),
- X( "EDEADLOCK",ERROR_POSSIBLE_DEADLOCK , 0 ),
- X( "ENAMETOOLONG", ERROR_FILENAME_EXCED_RANGE, 0 ),
- X( "ENOLCK", ERROR_SHARING_BUFFER_EXCEEDED , 0 ),
- X( "ENOSYS", ERROR_NOT_SUPPORTED , 0 ),
- X( "ENOTEMPTY",ERROR_DIR_NOT_EMPTY , 0 ),
- X( "ESPIPE", ERROR_SEEK_ON_DEVICE , 0 ),
-#if 0 /* FIXME: Find appropriate mappings. */
- X( "EILSEQ", ),
- X( "EDOM", ),
- X( "EMLINK", ),
- X( "ESRCH", ), /* No such process */
- X( "E2BIG", ), /* Arg list too long */
- X( "ENOEXEC", ), /* Exec format error */
- X( "ECHILD", ), /* No child processes */
- X( "EISDIR", ), /* Is a directory */
- X( "ENOTTY", ), /* Inappropriate I/O control operation */
- X( "EFBIG", ), /* File too large */
-#endif
-#undef X
-#else /*!RESOLVE_MACROS*/
-# include "mkw32errmap.tab.h"
-#endif /*!RESOLVE_MACROS*/
- { NULL, 0 }
- };
-
-
-
-static int
-compare_table (const void *a_v, const void *b_v)
-{
- const struct table_s *a = a_v;
- const struct table_s *b = b_v;
-
- return (a->w32code - b->w32code);
-}
-
-
-int
-main (int argc, char **argv)
-{
- int idx;
-
- for (idx=0; table[idx].name; idx++)
- ;
- qsort (table, idx, sizeof *table, compare_table);
-
- if (argc == 2 && !strcmp (argv[1], "--map"))
- {
- fputs ("static int\n"
- "map_w32codes (int err)\n"
- "{\n"
- " switch (err)\n"
- " {\n", stdout );
- for (idx=0; table[idx].name; idx++)
- if (table[idx].w32code2)
- printf (" case %d: return %d;\n",
- table[idx].w32code2, table[idx].w32code);
- fputs (" default: return err;\n"
- " }\n"
- "}\n", stdout);
- }
- else
- {
- fputs (header_gpg_extra_errno_h, stdout);
- for (idx=0; table[idx].name; idx++)
- printf ("#define %-12s %5d\n", table[idx].name, table[idx].w32code);
- fputs (footer_gpg_extra_errno_h, stdout);
- }
-
- return 0;
-}
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