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

@ -103,12 +103,7 @@ int main(int argc, char **argv)
if(!fp)
return 2;
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(file, &file_info) != 0) {
#else
if(fstat(fileno(fp), &file_info) != 0) {
#endif
fclose(fp);
return 1; /* cannot continue */
}

View file

@ -29,7 +29,7 @@
* filter IP addresses.
*/
#if defined(__AMIGA__) || defined(UNDER_CE)
#ifdef __AMIGA__
#include <stdio.h>
int main(void) { printf("Platform not supported.\n"); return 1; }
#else

View file

@ -46,11 +46,7 @@
#include <unistd.h> /* misc. Unix functions */
#endif
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
/* The IP address and port number to connect to */
#define IPADDR "127.0.0.1"

View file

@ -57,12 +57,7 @@ int main(void)
}
/* to get the file size */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat("debugit", &file_info) != 0) {
#else
if(fstat(fileno(fd), &file_info) != 0) {
#endif
fclose(fd);
curl_global_cleanup();
return 1; /* cannot continue */

View file

@ -28,11 +28,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
#ifdef _WIN32
#include <io.h>
#undef stat
@ -95,12 +91,7 @@ int main(void)
}
/* to get the file size */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(LOCAL_FILE, &file_info) != 0) {
#else
if(fstat(fileno(hd_src), &file_info) != 0) {
#endif
fclose(hd_src);
return 1; /* cannot continue */
}

View file

@ -77,9 +77,7 @@ static int upload(CURL *curl, const char *remotepath,
f = fopen(localpath, "rb");
if(!f) {
#ifndef UNDER_CE
perror(NULL);
#endif
return 0;
}

View file

@ -28,11 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf

View file

@ -30,11 +30,7 @@
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#ifdef UNDER_CE
#define strerror(e) "?"
#else
#include <errno.h>
#endif
/* somewhat Unix-specific */
#ifndef _MSC_VER
@ -231,14 +227,9 @@ static int setup(struct input *t, int num, const char *upload)
return 1;
}
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(upload, &file_info) != 0) {
#else
if(fstat(fileno(t->in), &file_info) != 0) {
#endif
fprintf(stderr, "error: could not stat file %s: %s\n",
upload, strerror(errno));
fprintf(stderr, "error: could not stat file %s: %s\n", upload,
strerror(errno));
fclose(t->out);
t->out = NULL;
return 1;

View file

@ -90,12 +90,7 @@ int main(int argc, char **argv)
return 2;
/* get the file size of the local file */
#ifdef UNDER_CE
/* !checksrc! disable BANNEDFUNC 1 */
if(stat(file, &file_info) != 0) {
#else
if(fstat(fileno(hd_src), &file_info) != 0) {
#endif
fclose(hd_src);
return 1; /* cannot continue */
}

View file

@ -32,9 +32,7 @@
*
*/
#ifndef UNDER_CE
#include <errno.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
@ -156,7 +154,7 @@ static int mem_addf(struct mem *mem, const char *format, ...)
return x;
}
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
/* Not all versions of Windows CRT vsnprintf are compliant with C99. Some
return -1 if buffer too small. Try _vscprintf to get the needed size. */
if(!i && x < 0) {
@ -297,11 +295,9 @@ int main(void)
}
}
else {
#ifndef UNDER_CE
mem_addf(&t->log, "Failed to create body output file %s: %s\n",
t->bodyfile, strerror(errno));
fprintf(stderr, "%s", t->log.recent);
#endif
failed = 1;
}
@ -310,12 +306,10 @@ int main(void)
if(fp && t->log.len == fwrite(t->log.buf, 1, t->log.len, fp))
fprintf(stderr, "Transfer log written to %s\n", t->logfile);
#ifndef UNDER_CE
else {
fprintf(stderr, "Failed to write transfer log to %s: %s\n",
t->logfile, strerror(errno));
}
#endif
if(fp)
fclose(fp);

View file

@ -92,9 +92,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath,
f = fopen(localpath, "rb");
if(!f) {
#ifndef UNDER_CE
perror(NULL);
#endif
return 0;
}
@ -103,7 +101,7 @@ static int sftpResumeUpload(CURL *curl, const char *remotepath,
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_cb);
curl_easy_setopt(curl, CURLOPT_READDATA, f);
#if defined(_WIN32) && !defined(UNDER_CE)
#ifdef _WIN32
_fseeki64(f, remoteFileSizeByte, SEEK_SET);
#else
fseek(f, (long)remoteFileSizeByte, SEEK_SET);