build: drop Windows CE / CeGCC support

Windows CE support was limited to successful builds with ming32ce
(a toolchain that hasn't seen an update since 2009, using an ancient gcc
version and "old mingw"-style SDK headers, that curl deprecated earlier).
Builds with MSVC were broken for a long time. mingw32ce builds were never
actually tested and runtime and unlikely to work due to missing stubs.
Windows CE toolchains also miss to comply with C89. Paired with lack of
demand and support for the platform, curl deprecated it earlier.

This patch removes support from the codebase to ease maintaining Windows
codepaths.

Follow-up to f98c0ba834 #17924
Follow-up to 8491e6574c #17379
Follow-up to 2a292c3984 #15975

Closes #17927
This commit is contained in:
Viktor Szakats 2025-07-15 00:36:08 +02:00
parent 2dc71ba8bf
commit 554dfa5568
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
81 changed files with 166 additions and 975 deletions

View file

@ -61,12 +61,7 @@ static CURLcode test_lib505(const char *URL)
}
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
hd = stat(libtest_arg2, &file_info);
#else
hd = fstat(fileno(hd_src), &file_info);
#endif
if(hd == -1) {
/* can't open file, bail out */
curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n",

View file

@ -52,12 +52,7 @@ static CURLcode test_lib525(const char *URL)
}
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
hd = stat(libtest_arg2, &file_info);
#else
hd = fstat(fileno(hd_src), &file_info);
#endif
if(hd == -1) {
/* can't open file, bail out */
curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n",

View file

@ -52,12 +52,7 @@ static CURLcode test_lib541(const char *URL)
}
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
hd = stat(libtest_arg2, &file_info);
#else
hd = fstat(fileno(hd_src), &file_info);
#endif
if(hd == -1) {
/* can't open file, bail out */
curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n",

View file

@ -80,11 +80,7 @@ again:
if(nread) {
/* send received stuff to stdout */
#ifdef UNDER_CE
if((size_t)fwrite(buf, sizeof(buf[0]), nread, stdout) != nread) {
#else
if((size_t)write(STDOUT_FILENO, buf, nread) != nread) {
#endif
char errbuf[STRERROR_LEN];
curl_mfprintf(stderr, "write() failed: errno %d (%s)\n",
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));

View file

@ -254,12 +254,7 @@ static CURLcode test_lib582(const char *URL)
}
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
hd = stat(libtest_arg2, &file_info);
#else
hd = fstat(fileno(hd_src), &file_info);
#endif
if(hd == -1) {
/* can't open file, bail out */
curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n",

View file

@ -48,9 +48,7 @@ struct entry_s {
extern const struct entry_s s_entries[];
#ifndef UNDER_CE
#include <signal.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

View file

@ -101,7 +101,7 @@ enum sockmode {
ACTIVE_DISCONNECT /* as a client, disconnected from server */
};
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
/*
* read-wrapper to support reading from stdin on Windows.
*/
@ -128,7 +128,7 @@ static ssize_t read_wincon(int fd, void *buf, size_t count)
return rcount;
}
CURL_SETERRNO((int)GetLastError());
errno = (int)GetLastError();
return -1;
}
@ -161,7 +161,7 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count)
return wcount;
}
CURL_SETERRNO((int)GetLastError());
errno = (int)GetLastError();
return -1;
}
#define SOCKFILT_read read_wincon
@ -171,8 +171,6 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count)
#define SOCKFILT_write write
#endif
#ifndef UNDER_CE
/* On Windows, we sometimes get this for a broken pipe, seemingly
* when the client just closed stdin? */
#define CURL_WIN32_EPIPE 109
@ -296,7 +294,6 @@ static bool read_stdin(void *buffer, size_t nbytes)
}
return TRUE;
}
#endif
/*
* write_stdout tries to write to stdio nbytes from the given buffer. This is a
@ -308,12 +305,7 @@ static bool read_stdin(void *buffer, size_t nbytes)
static bool write_stdout(const void *buffer, size_t nbytes)
{
ssize_t nwrite;
#ifdef UNDER_CE
puts(buffer);
nwrite = nbytes;
#else
nwrite = fullwrite(fileno(stdout), buffer, nbytes);
#endif
if(nwrite != (ssize_t)nbytes) {
logmsg("exiting...");
return FALSE;
@ -321,7 +313,6 @@ static bool write_stdout(const void *buffer, size_t nbytes)
return TRUE;
}
#ifndef UNDER_CE
static void lograw(unsigned char *buffer, ssize_t len)
{
char data[120];
@ -401,10 +392,8 @@ static bool read_data_block(unsigned char *buffer, ssize_t maxlen,
return TRUE;
}
#endif
#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#if defined(USE_WINSOCK) && !defined(CURL_WINDOWS_UWP)
/*
* Winsock select() does not support standard file descriptors,
* it can only check SOCKETs. The following function is an attempt
@ -867,8 +856,6 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
#define SOCKFILT_select(a,b,c,d,e) select(a,b,c,d,e)
#endif /* USE_WINSOCK */
#ifndef UNDER_CE
/* Perform the disconnect handshake with sockfilt
* This involves waiting for the disconnect acknowledgment after the DISC
* command, while throwing away anything else that might come in before
@ -923,7 +910,6 @@ static bool disc_handshake(void)
} while(TRUE);
return TRUE;
}
#endif
/*
sockfdp is a pointer to an established stream or CURL_SOCKET_BAD
@ -935,12 +921,6 @@ static bool juggle(curl_socket_t *sockfdp,
curl_socket_t listenfd,
enum sockmode *mode)
{
#ifdef UNDER_CE
(void)sockfdp;
(void)listenfd;
(void)mode;
return FALSE;
#else
struct timeval timeout;
fd_set fds_read;
fd_set fds_write;
@ -1217,7 +1197,6 @@ static bool juggle(curl_socket_t *sockfdp,
}
return TRUE;
#endif
}
static int test_sockfilt(int argc, char *argv[])

View file

@ -333,7 +333,7 @@ static SIGHANDLER_T old_sigterm_handler = SIG_ERR;
static SIGHANDLER_T old_sigbreak_handler = SIG_ERR;
#endif
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
static DWORD thread_main_id = 0;
static HANDLE thread_main_window = NULL;
static HWND hidden_main_window = NULL;
@ -344,7 +344,6 @@ static HWND hidden_main_window = NULL;
* The first time this is called it will set got_exit_signal to one and
* store in exit_signal the signal that triggered its execution.
*/
#ifndef UNDER_CE
/*
* Only call signal-safe functions from the signal handler, as required by
* the POSIX specification:
@ -387,11 +386,10 @@ static void exit_signal_handler(int signum)
#endif
}
(void)signal(signum, exit_signal_handler);
CURL_SETERRNO(old_errno);
errno = old_errno;
}
#endif
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
/* CTRL event handler for Windows Console applications to simulate
* SIGINT, SIGTERM and SIGBREAK on CTRL events and trigger signal handler.
*
@ -439,7 +437,7 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType)
}
#endif
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
/* Window message handler for Windows applications to add support
* for graceful process termination via taskkill (without /f) which
* sends WM_CLOSE to all Windows of a process (even hidden ones).
@ -519,7 +517,6 @@ static DWORD WINAPI main_window_loop(void *lpParameter)
}
#endif
#ifndef UNDER_CE
static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler,
bool restartable)
{
@ -549,7 +546,6 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler,
return oldhdlr;
#endif
}
#endif
void install_signal_handlers(bool keep_sigalrm)
{
@ -608,12 +604,10 @@ void install_signal_handlers(bool keep_sigalrm)
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
#endif
#ifdef _WIN32
#ifndef UNDER_CE
if(!SetConsoleCtrlHandler(ctrl_event_handler, TRUE))
logmsg("cannot install CTRL event handler");
#endif
#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#ifndef CURL_WINDOWS_UWP
thread_main_window = CreateThread(NULL, 0, &main_window_loop,
GetModuleHandle(NULL), 0, &thread_main_id);
if(!thread_main_window || !thread_main_id)
@ -653,10 +647,8 @@ void restore_signal_handlers(bool keep_sigalrm)
(void)set_signal(SIGBREAK, old_sigbreak_handler, FALSE);
#endif
#ifdef _WIN32
#ifndef UNDER_CE
(void)SetConsoleCtrlHandler(ctrl_event_handler, FALSE);
#endif
#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
#ifndef CURL_WINDOWS_UWP
if(thread_main_window && thread_main_id) {
if(PostThreadMessage(thread_main_id, WM_APP, 0, 0)) {
if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) {