From 554dfa556886c3d7425f6690f3fc408128bf4744 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 15 Jul 2025 00:36:08 +0200 Subject: [PATCH] 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 f98c0ba834d4b4da480373b732a86976f9064ccd #17924 Follow-up to 8491e6574cde770b227ca0e1cd66548291f49661 #17379 Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975 Closes #17927 --- CMake/CurlSymbolHiding.cmake | 2 +- CMake/win32-cache.cmake | 24 +-- CMakeLists.txt | 103 +++-------- acinclude.m4 | 12 +- configure.ac | 64 +------ docs/DEPRECATE.md | 8 +- docs/INSTALL.md | 4 +- docs/examples/anyauthput.c | 5 - docs/examples/block_ip.c | 2 +- docs/examples/externalsocket.c | 4 - docs/examples/fileupload.c | 5 - docs/examples/ftpupload.c | 9 - docs/examples/ftpuploadresume.c | 2 - docs/examples/http2-download.c | 4 - docs/examples/http2-upload.c | 13 +- docs/examples/httpput.c | 5 - docs/examples/log_failed_transfers.c | 8 +- docs/examples/sftpuploadresume.c | 4 +- include/curl/system.h | 21 +-- lib/asyn-thrdd.c | 2 +- lib/cf-socket.c | 13 -- lib/config-win32.h | 93 ++-------- lib/connect.c | 2 +- lib/curl_fopen.c | 9 +- lib/curl_setup.h | 43 +---- lib/curl_setup_once.h | 4 +- lib/curl_sspi.c | 4 - lib/curl_sspi.h | 252 --------------------------- lib/curl_threads.c | 13 +- lib/curlx/fopen.c | 10 +- lib/curlx/fopen.h | 2 +- lib/curlx/inet_ntop.c | 10 +- lib/curlx/inet_pton.c | 2 +- lib/curlx/strerr.c | 7 +- lib/curlx/version_win32.c | 8 +- lib/curlx/winapi.c | 5 +- lib/easy.c | 8 +- lib/file.c | 2 +- lib/ftp.c | 4 - lib/getenv.c | 2 +- lib/hostip.c | 2 - lib/md4.c | 5 - lib/md5.c | 4 - lib/memdebug.c | 2 +- lib/rename.c | 2 +- lib/sha256.c | 4 - lib/strerror.c | 2 +- lib/system_win32.c | 18 +- lib/transfer.c | 2 - lib/vtls/schannel.c | 30 +--- lib/vtls/schannel_verify.c | 77 -------- lib/vtls/vtls_scache.c | 5 +- m4/xc-lt-iface.m4 | 4 +- src/CMakeLists.txt | 2 +- src/terminal.c | 2 +- src/tool_cb_hdr.c | 2 +- src/tool_cb_rea.c | 6 +- src/tool_cb_see.c | 2 +- src/tool_cb_wrt.c | 6 +- src/tool_cfgable.c | 2 +- src/tool_cfgable.h | 4 +- src/tool_dirhie.c | 4 +- src/tool_doswin.c | 12 +- src/tool_doswin.h | 6 +- src/tool_formparse.c | 4 - src/tool_getparam.h | 2 +- src/tool_getpass.c | 4 +- src/tool_main.c | 11 +- src/tool_operate.c | 22 +-- src/tool_parsecfg.c | 2 +- src/tool_setup.h | 9 - src/tool_util.c | 11 +- src/tool_util.h | 2 +- tests/libtest/lib505.c | 5 - tests/libtest/lib525.c | 5 - tests/libtest/lib541.c | 5 - tests/libtest/lib556.c | 4 - tests/libtest/lib582.c | 5 - tests/server/first.h | 2 - tests/server/sockfilt.c | 29 +-- tests/server/util.c | 20 +-- 81 files changed, 166 insertions(+), 975 deletions(-) diff --git a/CMake/CurlSymbolHiding.cmake b/CMake/CurlSymbolHiding.cmake index 217c8832c9..2576a1aff3 100644 --- a/CMake/CurlSymbolHiding.cmake +++ b/CMake/CurlSymbolHiding.cmake @@ -29,7 +29,7 @@ if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG)) # e.g. curl_easy_perform_ev() or curl_dbg_*(), # so disable symbol hiding for debug builds and for memory tracking. set(CURL_HIDDEN_SYMBOLS OFF) -elseif(DOS OR AMIGA OR MINGW32CE) +elseif(DOS OR AMIGA) set(CURL_HIDDEN_SYMBOLS OFF) endif() diff --git a/CMake/win32-cache.cmake b/CMake/win32-cache.cmake index 8cb9b58b39..50c319d1b6 100644 --- a/CMake/win32-cache.cmake +++ b/CMake/win32-cache.cmake @@ -193,7 +193,7 @@ if(MINGW OR MSVC) curl_prefill_type_size("CURL_OFF_T" 8) curl_prefill_type_size("CURL_SOCKET_T" ${CMAKE_SIZEOF_VOID_P}) curl_prefill_type_size("SIZE_T" ${CMAKE_SIZEOF_VOID_P}) - # TIME_T: 8 for _WIN64 or UCRT or MSVC and not Windows CE, 4 otherwise + # TIME_T: 8 for _WIN64 or UCRT or MSVC, 4 otherwise # Also 4 for non-UCRT 32-bit when _USE_32BIT_TIME_T is set. # mingw-w64 sets _USE_32BIT_TIME_T unless __MINGW_USE_VC2005_COMPAT is explicit defined. if(MSVC) @@ -206,25 +206,3 @@ if(MINGW OR MSVC) curl_prefill_type_size("OFF_T" 8) # mingw-w64 v3+ endif() endif() - -# Windows CE exceptions - -if(WINCE) - set(HAVE_FREEADDRINFO 0) - set(HAVE_GETADDRINFO 0) - set(HAVE_LOCALE_H 0) - set(HAVE_SETLOCALE 0) - set(HAVE_SETMODE 0) - set(HAVE_SIGNAL 0) - set(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 0) - curl_prefill_type_size("CURL_SOCKET_T" 4) - curl_prefill_type_size("TIME_T" 4) - curl_prefill_type_size("SIZE_T" 4) - if(MINGW32CE) - set(HAVE_STRTOK_R 0) - set(HAVE__SETMODE 0) - set(HAVE_FILE_OFFSET_BITS 0) - curl_prefill_type_size("SSIZE_T" 4) - curl_prefill_type_size("OFF_T" 4) - endif() -endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 8113cdea90..0b9b666adb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,37 +71,6 @@ if(WINDOWS_STORE AND MINGW) # mingw UWP build # CMake (as of v3.31.2) gets confused and applies the MSVC rc.exe command-line # template to windres. Reset it to the windres template via 'Modules/Platform/Windows-windres.cmake': set(CMAKE_RC_COMPILE_OBJECT " -O coff ") -elseif(WIN32 AND WINCE AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # mingw32ce build - if(NOT MINGW32CE_LIBRARY_DIR) - message(FATAL_ERROR "Set MINGW32CE_LIBRARY_DIR variable to the mingw32ce platform library directory.") - endif() - - set(MINGW 1) - set(MINGW32CE 1) - - # Build implib with libcurl DLL. Copied from CMake's 'Modules/Platform/Windows-GNU.cmake'. - set(CMAKE_C_CREATE_SHARED_LIBRARY " ") - string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " -o -Wl,--out-implib,") - string(APPEND CMAKE_C_CREATE_SHARED_LIBRARY " ${CMAKE_GNULD_IMAGE_VERSION} ") - - # Build resources. Copied from CMake's 'Modules/Platform/Windows-windres.cmake'. - set(CMAKE_RC_COMPILE_OBJECT " -O coff ") - enable_language(RC) - - # To compile long long integer literals - set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-std=gnu99") - string(APPEND CMAKE_REQUIRED_FLAGS " -std=gnu99") - - set(CMAKE_C_COMPILE_OPTIONS_PIC "") # CMake sets it to '-fPIC', confusing the toolchain and breaking builds. Zap it. - - set(CMAKE_STATIC_LIBRARY_PREFIX "lib") - set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") - set(CMAKE_SHARED_LIBRARY_PREFIX "lib") - set(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") - set(CMAKE_IMPORT_LIBRARY_PREFIX "lib") - set(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a") - set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "") - set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib") elseif(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU") # DJGPP set(CMAKE_STATIC_LIBRARY_PREFIX "lib") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") @@ -130,9 +99,6 @@ endif() if(WIN32) string(APPEND _target_flags " WIN32") endif() -if(WINCE) - string(APPEND _target_flags " WINCE") -endif() if(WINDOWS_STORE) string(APPEND _target_flags " UWP") endif() @@ -213,12 +179,12 @@ option(CURL_DISABLE_INSTALL "Disable installation targets" OFF) if(WIN32) option(ENABLE_UNICODE "Use the Unicode version of the Windows API functions" OFF) - if(WINDOWS_STORE OR WINCE) + if(WINDOWS_STORE) set(ENABLE_UNICODE ON) endif() if(ENABLE_UNICODE) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "UNICODE" "_UNICODE") - if(MINGW AND NOT MINGW32CE) + if(MINGW) set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-municode") endif() endif() @@ -538,7 +504,7 @@ if(HTTP_ONLY) set(CURL_DISABLE_TFTP ON) endif() -if(WINDOWS_STORE OR WINCE) +if(WINDOWS_STORE) set(CURL_DISABLE_TELNET ON) # telnet code needs fixing to compile for UWP. endif() @@ -624,21 +590,7 @@ if(ENABLE_THREADED_RESOLVER) endif() # Check for all needed libraries -if(WIN32) - if(WINCE) - set(_win32_winsock "ws2") - else() - set(_win32_winsock "ws2_32") - endif() - set(_win32_crypt32 "crypt32") - set(_win32_secur32 "secur32") - - if(MINGW32CE) # FIXME upstream: must specify the full path to avoid CMake converting "ws2" to "ws2.lib" - set(_win32_winsock "${MINGW32CE_LIBRARY_DIR}/lib${_win32_winsock}.a") - set(_win32_crypt32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_crypt32}.a") - set(_win32_secur32 "${MINGW32CE_LIBRARY_DIR}/lib${_win32_secur32}.a") - endif() -elseif(DOS) +if(DOS) if(WATT_ROOT) set(USE_WATT32 ON) # FIXME upstream: must specify the full path to avoid CMake converting "watt" to "watt.lib" @@ -659,7 +611,7 @@ elseif(AMIGA) set(CURL_USE_OPENSSL ON) set(CURL_CA_FALLBACK ON CACHE BOOL "") endif() -elseif(NOT APPLE) +elseif(NOT WIN32 AND NOT APPLE) check_library_exists("socket" "connect" "" HAVE_LIBSOCKET) if(HAVE_LIBSOCKET) set(CURL_NETWORK_AND_TIME_LIBS "socket" ${CURL_NETWORK_AND_TIME_LIBS}) @@ -694,7 +646,7 @@ if(ENABLE_IPV6) endif() endif() endif() -if(ENABLE_IPV6 AND NOT WINCE) +if(ENABLE_IPV6) set(USE_IPV6 ON) endif() @@ -1035,7 +987,7 @@ macro(curl_openssl_check_exists) if(HAVE_LIBZ) list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) endif() - if(WIN32 AND NOT WINCE) + if(WIN32) list(APPEND CMAKE_REQUIRED_LIBRARIES "bcrypt") # for OpenSSL/LibreSSL endif() endif() @@ -1049,7 +1001,7 @@ macro(curl_openssl_check_exists) list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DHAVE_UINTPTR_T") # to pull in stdint.h (as of wolfSSL v5.5.4) endif() if(WIN32) - list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}" "${_win32_crypt32}") # for OpenSSL/wolfSSL + list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32" "crypt32") # for OpenSSL/wolfSSL endif() if(${ARGC} EQUAL 2) check_function_exists(${ARGN}) @@ -1262,7 +1214,7 @@ if(NOT CURL_DISABLE_SRP AND (HAVE_GNUTLS_SRP OR HAVE_OPENSSL_SRP)) endif() if(NOT CURL_DISABLE_LDAP) - if(WIN32 AND NOT WINDOWS_STORE AND NOT WINCE) + if(WIN32 AND NOT WINDOWS_STORE) option(USE_WIN32_LDAP "Use Windows LDAP implementation" ON) if(USE_WIN32_LDAP) list(APPEND CURL_LIBS "wldap32") @@ -1501,7 +1453,7 @@ if(USE_LIBRTMP) endif() option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) -if(ENABLE_UNIX_SOCKETS AND NOT WINCE) +if(ENABLE_UNIX_SOCKETS) if(WIN32 OR DOS) set(USE_UNIX_SOCKETS 1) else() @@ -1618,7 +1570,7 @@ if(WIN32) list(APPEND CURL_INCLUDES "winsock2.h") list(APPEND CURL_INCLUDES "ws2tcpip.h") - if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501 AND NOT WINCE) + if(HAVE_WIN32_WINNT AND HAVE_WIN32_WINNT LESS 0x0501) # Windows XP is required for freeaddrinfo, getaddrinfo message(FATAL_ERROR "Building for Windows XP or newer is required.") endif() @@ -1626,7 +1578,7 @@ if(WIN32) # Pre-fill detection results based on target OS version if(_CURL_PREFILL) if(NOT HAVE_WIN32_WINNT OR HAVE_WIN32_WINNT LESS 0x0600 OR # older than Windows Vista - WINCE OR WINDOWS_STORE) + WINDOWS_STORE) set(HAVE_IF_NAMETOINDEX 0) unset(HAVE_IF_NAMETOINDEX CACHE) elseif(MSVC OR MINGW) @@ -1734,8 +1686,8 @@ endif() # Apply to all feature checks if(WIN32) - list(APPEND CMAKE_REQUIRED_LIBRARIES "${_win32_winsock}") - if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CMAKE_REQUIRED_LIBRARIES "ws2_32") + if(NOT WINDOWS_STORE) list(APPEND CMAKE_REQUIRED_LIBRARIES "iphlpapi") endif() elseif(HAVE_LIBSOCKET) @@ -1805,11 +1757,9 @@ else() check_symbol_exists("strcmpi" "string.h" HAVE_STRCMPI) endif() -if(NOT MINGW32CE) # Avoid false detections - check_function_exists("setmode" HAVE_SETMODE) - if(WIN32 OR CYGWIN) - check_function_exists("_setmode" HAVE__SETMODE) - endif() +check_function_exists("setmode" HAVE_SETMODE) +if(WIN32 OR CYGWIN) + check_function_exists("_setmode" HAVE__SETMODE) endif() if(AMIGA) @@ -1971,17 +1921,13 @@ include(CMake/OtherTests.cmake) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_CONFIG_H") if(WIN32) - list(APPEND CURL_NETWORK_AND_TIME_LIBS "${_win32_winsock}") - if(NOT WINCE AND NOT WINDOWS_STORE) + list(APPEND CURL_NETWORK_AND_TIME_LIBS "ws2_32") + if(NOT WINDOWS_STORE) list(APPEND CURL_NETWORK_AND_TIME_LIBS "iphlpapi") endif() - if(NOT WINCE) - list(APPEND CURL_LIBS "bcrypt") - endif() + list(APPEND CURL_LIBS "bcrypt") - if(NOT WINCE) - set(USE_WIN32_LARGE_FILES ON) - endif() + set(USE_WIN32_LARGE_FILES ON) # We use crypto functions that are not available for UWP apps if(NOT WINDOWS_STORE) @@ -1990,13 +1936,10 @@ if(WIN32) # Link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL if(USE_WIN32_CRYPTO OR USE_SCHANNEL) - if(NOT WINCE) - list(APPEND CURL_LIBS "advapi32") - endif() - list(APPEND CURL_LIBS "${_win32_crypt32}") + list(APPEND CURL_LIBS "advapi32" "crypt32") endif() if(USE_WINDOWS_SSPI) - list(APPEND CURL_LIBS "${_win32_secur32}") + list(APPEND CURL_LIBS "secur32") endif() endif() diff --git a/acinclude.m4 b/acinclude.m4 index 517de0c4a6..7038f32a8b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1315,13 +1315,8 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [ AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl if test "$curl_cv_native_windows" = 'yes'; then AC_MSG_CHECKING([whether build target supports Win32 large files]) - if test "$curl_cv_wince" = 'yes'; then - dnl Windows CE does not support large files - curl_win32_has_largefile='no' - else - dnl All mingw-w64 versions support large files - curl_win32_has_largefile='yes' - fi + dnl All mingw-w64 versions support large files + curl_win32_has_largefile='yes' case "$curl_win32_has_largefile" in yes) if test x"$enable_largefile" = 'xno'; then @@ -1478,9 +1473,6 @@ AC_DEFUN([CURL_PREPARE_BUILDINFO], [ if test "$curl_cv_native_windows" = 'yes'; then curl_pflags="${curl_pflags} WIN32" fi - if test "$curl_cv_wince" = 'yes'; then - curl_pflags="${curl_pflags} WINCE" - fi if test "$curl_cv_winuwp" = 'yes'; then curl_pflags="${curl_pflags} UWP" fi diff --git a/configure.ac b/configure.ac index e493369b9d..9602be344f 100644 --- a/configure.ac +++ b/configure.ac @@ -529,12 +529,8 @@ dnl for --enable-code-coverage CURL_COVERAGE CURL_CHECK_NATIVE_WINDOWS -curl_cv_wince='no' curl_cv_winuwp='no' if test "$curl_cv_native_windows" = "yes"; then - case $host_os in - mingw32ce*) curl_cv_wince='yes';; - esac case "$CPPFLAGS" in *-DWINSTORECOMPAT*) curl_cv_winuwp='yes';; esac @@ -896,7 +892,7 @@ AS_HELP_STRING([--disable-telnet],[Disable TELNET support]), AC_MSG_RESULT(yes) ) -if test "$curl_cv_winuwp" = 'yes' -o "$curl_cv_wince" = 'yes'; then +if test "$curl_cv_winuwp" = 'yes'; then AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) CURL_DISABLE_TELNET=1 fi @@ -1177,37 +1173,6 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then ]) fi -if test "$HAVE_GETHOSTBYNAME" != "1"; then - if test "$curl_cv_wince" = 'yes'; then - dnl This is for Windows CE systems - winsock_LIB="-lws2" - if test ! -z "$winsock_LIB"; then - my_ac_save_LIBS=$LIBS - LIBS="$winsock_LIB $LIBS" - AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - #ifdef _WIN32 - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - #include - #endif - ]],[[ - gethostbyname("localhost"); - ]]) - ],[ - AC_MSG_RESULT([yes]) - HAVE_GETHOSTBYNAME="1" - ],[ - AC_MSG_RESULT([no]) - winsock_LIB="" - LIBS=$my_ac_save_LIBS - ]) - fi - fi -fi - # In UWP mode gethostbyname gets detected via the core libs, but some # code (in6addr_any) still need ws2_32, so let us detect and add it. if test "$HAVE_GETHOSTBYNAME" != "1" -o "$curl_cv_winuwp" = "yes"; then @@ -1693,10 +1658,6 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), ) ) -if test "$curl_cv_wince" = 'yes'; then - ipv6=no -fi - if test "$ipv6" = yes; then curl_ipv6_msg="enabled" AC_DEFINE(USE_IPV6, 1, [Define if you want to enable IPv6 support]) @@ -1998,14 +1959,11 @@ CURL_WITH_APPLE_SECTRUST dnl link required libraries for USE_WIN32_CRYPTO or SCHANNEL_ENABLED if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$SCHANNEL_ENABLED" = "x1"; then - LIBS="-lcrypt32 $LIBS" - if test "$curl_cv_wince" = 'no'; then - LIBS="-ladvapi32 $LIBS" - fi + LIBS="-ladvapi32 -lcrypt32 $LIBS" fi dnl link bcrypt for BCryptGenRandom() (used when building for Vista or newer) -if test "x$curl_cv_native_windows" = "xyes" -a "$curl_cv_wince" = 'no'; then +if test "x$curl_cv_native_windows" = "xyes"; then LIBS="-lbcrypt $LIBS" fi @@ -2750,11 +2708,7 @@ dnl ---------------------------- dnl check Windows Unicode option dnl ---------------------------- -if test "$curl_cv_wince" = 'yes'; then - want_winuni="yes" -else - want_winuni="no" -fi +want_winuni="no" if test "$curl_cv_native_windows" = "yes"; then if test "$curl_cv_winuwp" = 'yes'; then want_winuni="yes" @@ -4266,11 +4220,9 @@ else CURL_CHECK_FUNC_STRICMP fi -if test "$curl_cv_wince" = 'no'; then - AC_CHECK_FUNCS([setmode]) - if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then - AC_CHECK_FUNCS([_setmode]) - fi +AC_CHECK_FUNCS([setmode]) +if test "$curl_cv_native_windows" = 'yes' -o "$curl_cv_cygwin" = 'yes'; then + AC_CHECK_FUNCS([_setmode]) fi if test -z "$ssl_backends"; then @@ -4639,7 +4591,7 @@ AS_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), want_unix_sockets=auto ] ) -if test "x$want_unix_sockets" != "xno" -a "$curl_cv_wince" = 'no'; then +if test "x$want_unix_sockets" != "xno"; then if test "x$curl_cv_native_windows" = "xyes"; then USE_UNIX_SOCKETS=1 AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 48c44e6c6b..d02174d8ca 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -12,13 +12,6 @@ email the as soon as possible and explain to us why this is a problem for you and how your use case cannot be satisfied properly using a workaround. -## Windows CE - -Windows CE "mainstream support" ended on October 9, 2018, and "Extended -Support" ended on October 10, 2023. - -curl drops all support in November 2025. - ## VS2008 curl drops support for getting built with Microsoft Visual Studio 2008 in @@ -100,3 +93,4 @@ Support for RTMP in libcurl gets removed in April 2026. - BearSSL (removed in 8.15.0) - msh3 (removed in 8.16.0) - winbuild build system (removed in 8.17.0) + - Windows CE (removed in 8.18.0) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index dfbc1eebfd..0db7848a22 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -650,7 +650,7 @@ This is a probably incomplete list of known CPU architectures and operating systems that curl has been compiled for. If you know a system curl compiles and runs on, that is not listed, please let us know. -## 109 Operating Systems +## 108 Operating Systems AIX, AmigaOS, Android, ArcaOS, Aros, Atari FreeMiNT, Azure Sphere, BeOS, Blackberry 10, Blackberry Tablet OS, Cell OS, Cesium, CheriBSD, Chrome OS, @@ -665,7 +665,7 @@ and runs on, that is not listed, please let us know. SINIX-Z, SkyOS, SmartOS, Solaris, Sortix, SunOS, Syllable OS, Symbian, Tizen, TPF, Tru64, tvOS, ucLinux, Ultrix, UNICOS, UnixWare, visionOS, VMS, vxWorks, watchOS, Wear OS, WebOS, Wii System Software, Wii U, Windows, - Windows CE, Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr + Xbox System, Xenix, z/OS, z/TPF, z/VM, z/VSE, Zephyr ## 28 CPU Architectures diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index b13593a041..12d8de76c9 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -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 */ } diff --git a/docs/examples/block_ip.c b/docs/examples/block_ip.c index b99fab58c3..290f92a61e 100644 --- a/docs/examples/block_ip.c +++ b/docs/examples/block_ip.c @@ -29,7 +29,7 @@ * filter IP addresses. */ -#if defined(__AMIGA__) || defined(UNDER_CE) +#ifdef __AMIGA__ #include int main(void) { printf("Platform not supported.\n"); return 1; } #else diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 7415cff81f..6cab781a46 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -46,11 +46,7 @@ #include /* misc. Unix functions */ #endif -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif /* The IP address and port number to connect to */ #define IPADDR "127.0.0.1" diff --git a/docs/examples/fileupload.c b/docs/examples/fileupload.c index 03dd323bda..fa9de2aa4f 100644 --- a/docs/examples/fileupload.c +++ b/docs/examples/fileupload.c @@ -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 */ diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 26db7f5953..b334ad3273 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -28,11 +28,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif #ifdef _WIN32 #include #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 */ } diff --git a/docs/examples/ftpuploadresume.c b/docs/examples/ftpuploadresume.c index ea972ec193..e9d723d70d 100644 --- a/docs/examples/ftpuploadresume.c +++ b/docs/examples/ftpuploadresume.c @@ -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; } diff --git a/docs/examples/http2-download.c b/docs/examples/http2-download.c index ca61a92d91..e58742e59c 100644 --- a/docs/examples/http2-download.c +++ b/docs/examples/http2-download.c @@ -28,11 +28,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#endif #if defined(_MSC_VER) && (_MSC_VER < 1900) #define snprintf _snprintf diff --git a/docs/examples/http2-upload.c b/docs/examples/http2-upload.c index 7ba150e91a..84b0e18ea1 100644 --- a/docs/examples/http2-upload.c +++ b/docs/examples/http2-upload.c @@ -30,11 +30,7 @@ #include #include #include -#ifdef UNDER_CE -#define strerror(e) "?" -#else #include -#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; diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 794ea99ae5..a7fac75b4a 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -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 */ } diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index 350d41affa..23208d232c 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -32,9 +32,7 @@ * */ -#ifndef UNDER_CE #include -#endif #include #include #include @@ -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); diff --git a/docs/examples/sftpuploadresume.c b/docs/examples/sftpuploadresume.c index cb5d1cf33e..72ae41382c 100644 --- a/docs/examples/sftpuploadresume.c +++ b/docs/examples/sftpuploadresume.c @@ -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); diff --git a/include/curl/system.h b/include/curl/system.h index 62ed2b0f43..a5b3e9eba7 100644 --- a/include/curl/system.h +++ b/include/curl/system.h @@ -135,21 +135,12 @@ # endif #elif defined(UNDER_CE) -# ifdef __MINGW32CE__ -# define CURL_TYPEOF_CURL_OFF_T long long -# define CURL_FORMAT_CURL_OFF_T "lld" -# define CURL_FORMAT_CURL_OFF_TU "llu" -# define CURL_SUFFIX_CURL_OFF_T LL -# define CURL_SUFFIX_CURL_OFF_TU ULL -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# else -# define CURL_TYPEOF_CURL_OFF_T __int64 -# define CURL_FORMAT_CURL_OFF_T "I64d" -# define CURL_FORMAT_CURL_OFF_TU "I64u" -# define CURL_SUFFIX_CURL_OFF_T i64 -# define CURL_SUFFIX_CURL_OFF_TU ui64 -# define CURL_TYPEOF_CURL_SOCKLEN_T int -# endif +# define CURL_TYPEOF_CURL_OFF_T __int64 +# define CURL_FORMAT_CURL_OFF_T "I64d" +# define CURL_FORMAT_CURL_OFF_TU "I64u" +# define CURL_SUFFIX_CURL_OFF_T i64 +# define CURL_SUFFIX_CURL_OFF_TU ui64 +# define CURL_TYPEOF_CURL_SOCKLEN_T int #elif defined(__MINGW32__) # include diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index d1652d0ff4..07b6663049 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -473,7 +473,7 @@ static bool async_thrdd_init(struct Curl_easy *data, err_exit: CURL_TRC_DNS(data, "resolve thread failed init: %d", err); async_thrdd_destroy(data); - CURL_SETERRNO(err); + errno = err; return FALSE; } diff --git a/lib/cf-socket.c b/lib/cf-socket.c index a8fa997de0..d1a99d3ece 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -853,24 +853,11 @@ static bool verifyconnect(curl_socket_t sockfd, int *error) * * Someone got to verify this on Win-NT 4.0, 2000." */ - -#ifdef UNDER_CE - Sleep(0); -#else SleepEx(0, FALSE); -#endif - #endif if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&err, &errSize)) err = SOCKERRNO; -#ifdef UNDER_CE - /* Old Windows CE versions do not support SO_ERROR */ - if(WSAENOPROTOOPT == err) { - SET_SOCKERRNO(0); - err = 0; - } -#endif #if defined(EBADIOCTL) && defined(__minix) /* Minix 3.1.x does not support getsockopt on UDP sockets */ if(EBADIOCTL == err) { diff --git a/lib/config-win32.h b/lib/config-win32.h index 408606d611..bf9038a894 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -28,8 +28,6 @@ /* Hand crafted config file for Windows */ /* ================================================================ */ -#ifndef UNDER_CE - /* Define some minimum and default build targets for Visual Studio */ #ifdef _MSC_VER /* VS2012 default target settings and minimum build target check. */ @@ -78,8 +76,6 @@ # endif #endif /* _MSC_VER */ -#endif /* UNDER_CE */ - /* ---------------------------------------------------------------- */ /* HEADER FILES */ /* ---------------------------------------------------------------- */ @@ -87,19 +83,15 @@ /* Define if you have the header file. */ /* #define HAVE_ARPA_INET_H 1 */ -#ifndef UNDER_CE - /* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 /* exists on __MINGW32CE__ */ +#define HAVE_FCNTL_H 1 /* Define if you have the header file. */ -#define HAVE_IO_H 1 /* exists on __MINGW32CE__ */ +#define HAVE_IO_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 -#endif - /* Define if you have the header file. */ /* #define HAVE_NETDB_H 1 */ @@ -107,10 +99,8 @@ /* #define HAVE_NETINET_IN_H 1 */ /* Define to 1 if you have the header file. */ -#ifndef UNDER_CE #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__) -#define HAVE_STDBOOL_H 1 /* exists on __MINGW32CE__ */ -#endif +#define HAVE_STDBOOL_H 1 #endif /* Define to 1 if you have the header file. */ @@ -159,10 +149,8 @@ #define STDC_HEADERS 1 /* Define to 1 if bool is an available type. */ -#ifndef UNDER_CE #if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || defined(__MINGW32__) -#define HAVE_BOOL_T 1 /* exists on __MINGW32CE__ */ -#endif +#define HAVE_BOOL_T 1 #endif /* ---------------------------------------------------------------- */ @@ -200,7 +188,6 @@ /* Define if you have the select function. */ #define HAVE_SELECT 1 -#ifndef UNDER_CE /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 @@ -209,7 +196,6 @@ /* Define if you have the _setmode function. */ #define HAVE__SETMODE 1 -#endif /* Define if you have the socket function. */ #define HAVE_SOCKET 1 @@ -276,9 +262,7 @@ #endif /* Define to 1 if you have the signal function. */ -#ifndef UNDER_CE #define HAVE_SIGNAL 1 -#endif /* ---------------------------------------------------------------- */ /* TYPEDEF REPLACEMENTS */ @@ -347,11 +331,9 @@ #endif /* Windows XP is required for freeaddrinfo, getaddrinfo */ -#ifndef UNDER_CE #define HAVE_FREEADDRINFO 1 #define HAVE_GETADDRINFO 1 #define HAVE_GETADDRINFO_THREADSAFE 1 -#endif /* ---------------------------------------------------------------- */ /* STRUCT RELATED */ @@ -370,8 +352,6 @@ /* LARGE FILE SUPPORT */ /* ---------------------------------------------------------------- */ -#ifndef UNDER_CE - #if defined(_MSC_VER) || defined(__MINGW32__) # define USE_WIN32_LARGE_FILES /* Number of bits in a file offset, on hosts where this is settable. */ @@ -390,8 +370,6 @@ # define SIZEOF_OFF_T 4 #endif -#endif /* UNDER_CE */ - /* ---------------------------------------------------------------- */ /* DNS RESOLVER SPECIALTY */ /* ---------------------------------------------------------------- */ @@ -420,7 +398,7 @@ #ifdef CURL_HAS_OPENLDAP_LDAPSDK #undef USE_WIN32_LDAP #define HAVE_LDAP_URL_PARSE 1 -#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#elif !defined(CURL_WINDOWS_UWP) #undef HAVE_LDAP_URL_PARSE #define HAVE_LDAP_SSL 1 #define USE_WIN32_LDAP 1 @@ -432,9 +410,7 @@ #endif /* Define to use Unix sockets. */ -#ifndef UNDER_CE #define USE_UNIX_SOCKETS -#endif /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */ @@ -442,52 +418,19 @@ /* Define cpu-machine-OS */ #ifndef CURL_OS -# ifdef UNDER_CE -# ifdef _M_ARM -# define CURL_OS "arm-pc-win32ce" -# else -# define CURL_OS "i386-pc-win32ce" -# endif -# else /* !UNDER_CE */ -# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ -# define CURL_OS "i386-pc-win32" -# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */ -# define CURL_OS "x86_64-pc-win32" -# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */ -# define CURL_OS "ia64-pc-win32" -# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */ -# define CURL_OS "thumbv7a-pc-win32" -# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */ -# define CURL_OS "aarch64-pc-win32" -# else -# define CURL_OS "unknown-pc-win32" -# endif -# endif /* UNDER_CE */ +# if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */ +# define CURL_OS "i386-pc-win32" +# elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (VS2005+ or gcc) */ +# define CURL_OS "x86_64-pc-win32" +# elif defined(_M_IA64) || defined(__ia64__) /* Itanium */ +# define CURL_OS "ia64-pc-win32" +# elif defined(_M_ARM_NT) || defined(__arm__) /* ARMv7-Thumb2 */ +# define CURL_OS "thumbv7a-pc-win32" +# elif defined(_M_ARM64) || defined(__aarch64__) /* ARM64 (Windows 10) */ +# define CURL_OS "aarch64-pc-win32" +# else +# define CURL_OS "unknown-pc-win32" +# endif #endif /* !CURL_OS */ -/* ---------------------------------------------------------------- */ -/* Windows CE */ -/* ---------------------------------------------------------------- */ - -#ifdef UNDER_CE - -#ifndef UNICODE -#define UNICODE -#endif - -#ifndef _UNICODE -#define _UNICODE -#endif - -#define CURL_DISABLE_FILE 1 -#define CURL_DISABLE_TELNET 1 -#define CURL_DISABLE_LDAP 1 - -#ifndef _MSC_VER -/* !checksrc! disable BANNEDFUNC 1 */ -extern int stat(const char *path, struct stat *buffer); -#endif - -#endif /* UNDER_CE */ - #endif /* HEADER_CURL_CONFIG_WIN32_H */ diff --git a/lib/connect.c b/lib/connect.c index 573b02952b..b5de9b4f5e 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -280,7 +280,7 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, addr[0] = '\0'; *port = 0; - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return FALSE; } diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index c41cff21cd..fd0c7c65d2 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -101,14 +101,7 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, *fh = curlx_fopen(filename, FOPEN_WRITETEXT); if(!*fh) goto fail; - if( -#ifdef UNDER_CE - /* !checksrc! disable BANNEDFUNC 1 */ - stat(filename, &sb) == -1 -#else - fstat(fileno(*fh), &sb) == -1 -#endif - || !S_ISREG(sb.st_mode)) { + if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) { return CURLE_OK; } curlx_fclose(*fh); diff --git a/lib/curl_setup.h b/lib/curl_setup.h index d41c9b8cea..fe3b9e0ee3 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -75,7 +75,7 @@ #endif #endif -#if defined(__MINGW32__) && !defined(__MINGW32CE__) && \ +#if defined(__MINGW32__) && \ (!defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 3)) #error "Building curl requires mingw-w64 3.0 or later" #endif @@ -122,14 +122,6 @@ # endif #endif -/* Avoid bogus format check warnings with mingw32ce gcc 4.4.0 in - C99 (-std=gnu99) mode */ -#if defined(__MINGW32CE__) && !defined(CURL_NO_FMT_CHECKS) && \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) && \ - (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)) -#define CURL_NO_FMT_CHECKS -#endif - /* Compatibility */ #ifdef ENABLE_IPV6 #define USE_IPV6 1 @@ -497,12 +489,10 @@ # define LSEEK_ERROR (__int64)-1 # else /* Small file (<2Gb) support using Win32 functions. */ -# ifndef UNDER_CE -# undef lseek -# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) -# define fstat(fdes, stp) _fstat(fdes, stp) -# define struct_stat struct _stat -# endif +# undef lseek +# define lseek(fdes, offset, whence) _lseek(fdes, (long)offset, whence) +# define fstat(fdes, stp) _fstat(fdes, stp) +# define struct_stat struct _stat # define LSEEK_ERROR (long)-1 # endif #elif defined(__DJGPP__) @@ -817,27 +807,6 @@ #include "curl_setup_once.h" #endif -#ifdef UNDER_CE -#define getenv curl_getenv /* Windows CE does not support getenv() */ -#define raise(s) ((void)(s)) -/* Terrible workarounds to make Windows CE compile */ -#define errno 0 -#define CURL_SETERRNO(x) ((void)(x)) -#define EINTR 4 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EEXIST 17 -#define EISDIR 21 -#define EINVAL 22 -#define ENOSPC 28 -#define strerror(x) "?" -#undef STDIN_FILENO -#define STDIN_FILENO 0 -#else -#define CURL_SETERRNO(x) (errno = (x)) -#endif - /* * Definition of our NOP statement Object-like macro */ @@ -926,7 +895,7 @@ endings either CRLF or LF so 't' is appropriate. /* for systems that do not detect this in configure */ #ifndef CURL_SA_FAMILY_T -# if defined(_WIN32) && !defined(UNDER_CE) +# ifdef _WIN32 # define CURL_SA_FAMILY_T ADDRESS_FAMILY # elif defined(HAVE_SA_FAMILY_T) # define CURL_SA_FAMILY_T sa_family_t diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 7a54760e16..1c2194c502 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -33,9 +33,7 @@ #include #include #include -#ifndef UNDER_CE #include -#endif #ifdef HAVE_SYS_TYPES_H #include @@ -356,7 +354,7 @@ typedef unsigned int bit; #ifdef __VMS #define argv_item_t __char_ptr32 -#elif defined(_UNICODE) && !defined(UNDER_CE) +#elif defined(_UNICODE) #define argv_item_t wchar_t * #else #define argv_item_t char * diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index c819b1c22e..32b4c894d6 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -62,11 +62,7 @@ CURLcode Curl_sspi_global_init(void) /* If security interface is not yet initialized try to do this */ if(!Curl_pSecFn) { /* Get pointer to Security Service Provider Interface dispatch table */ -#ifdef __MINGW32CE__ - Curl_pSecFn = InitSecurityInterfaceW(); -#else Curl_pSecFn = InitSecurityInterface(); -#endif if(!Curl_pSecFn) return CURLE_FAILED_INIT; } diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index 8ecd81fdea..89ebc9b0ba 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -70,225 +70,6 @@ extern PSecurityFunctionTable Curl_pSecFn; #define ISC_REQ_USE_HTTP_STYLE 0x01000000 #endif -#ifdef __MINGW32CE__ -#ifndef ISC_RET_REPLAY_DETECT -#define ISC_RET_REPLAY_DETECT 0x00000004 -#endif -#ifndef ISC_RET_SEQUENCE_DETECT -#define ISC_RET_SEQUENCE_DETECT 0x00000008 -#endif -#ifndef ISC_RET_CONFIDENTIALITY -#define ISC_RET_CONFIDENTIALITY 0x00000010 -#endif -#ifndef ISC_RET_ALLOCATED_MEMORY -#define ISC_RET_ALLOCATED_MEMORY 0x00000100 -#endif -#ifndef ISC_RET_STREAM -#define ISC_RET_STREAM 0x00008000 -#endif - -#ifndef SEC_E_INSUFFICIENT_MEMORY -#define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L) -#endif -#ifndef SEC_E_INVALID_HANDLE -#define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L) -#endif -#ifndef SEC_E_UNSUPPORTED_FUNCTION -#define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L) -#endif -#ifndef SEC_E_TARGET_UNKNOWN -#define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L) -#endif -#ifndef SEC_E_INTERNAL_ERROR -#define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L) -#endif -#ifndef SEC_E_SECPKG_NOT_FOUND -#define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L) -#endif -#ifndef SEC_E_NOT_OWNER -#define SEC_E_NOT_OWNER ((HRESULT)0x80090306L) -#endif -#ifndef SEC_E_CANNOT_INSTALL -#define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L) -#endif -#ifndef SEC_E_INVALID_TOKEN -#define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L) -#endif -#ifndef SEC_E_CANNOT_PACK -#define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L) -#endif -#ifndef SEC_E_QOP_NOT_SUPPORTED -#define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL) -#endif -#ifndef SEC_E_NO_IMPERSONATION -#define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL) -#endif -#ifndef SEC_E_LOGON_DENIED -#define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL) -#endif -#ifndef SEC_E_UNKNOWN_CREDENTIALS -#define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL) -#endif -#ifndef SEC_E_NO_CREDENTIALS -#define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL) -#endif -#ifndef SEC_E_MESSAGE_ALTERED -#define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL) -#endif -#ifndef SEC_E_OUT_OF_SEQUENCE -#define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L) -#endif -#ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY -#define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L) -#endif -#ifndef SEC_E_BAD_PKGID -#define SEC_E_BAD_PKGID ((HRESULT)0x80090316L) -#endif -#ifndef SEC_E_CONTEXT_EXPIRED -#define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L) -#endif -#ifndef SEC_E_INCOMPLETE_MESSAGE -#define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L) -#endif -#ifndef SEC_E_INCOMPLETE_CREDENTIALS -#define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L) -#endif -#ifndef SEC_E_BUFFER_TOO_SMALL -#define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L) -#endif -#ifndef SEC_E_WRONG_PRINCIPAL -#define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L) -#endif -#ifndef SEC_E_TIME_SKEW -#define SEC_E_TIME_SKEW ((HRESULT)0x80090324L) -#endif -#ifndef SEC_E_UNTRUSTED_ROOT -#define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L) -#endif -#ifndef SEC_E_ILLEGAL_MESSAGE -#define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L) -#endif -#ifndef SEC_E_CERT_UNKNOWN -#define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L) -#endif -#ifndef SEC_E_CERT_EXPIRED -#define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L) -#endif -#ifndef SEC_E_ENCRYPT_FAILURE -#define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L) -#endif -#ifndef SEC_E_DECRYPT_FAILURE -#define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L) -#endif -#ifndef SEC_E_ALGORITHM_MISMATCH -#define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L) -#endif -#ifndef SEC_E_SECURITY_QOS_FAILED -#define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L) -#endif -#ifndef SEC_E_UNFINISHED_CONTEXT_DELETED -#define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L) -#endif -#ifndef SEC_E_NO_TGT_REPLY -#define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L) -#endif -#ifndef SEC_E_NO_IP_ADDRESSES -#define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L) -#endif -#ifndef SEC_E_WRONG_CREDENTIAL_HANDLE -#define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L) -#endif -#ifndef SEC_E_CRYPTO_SYSTEM_INVALID -#define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L) -#endif -#ifndef SEC_E_MAX_REFERRALS_EXCEEDED -#define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L) -#endif -#ifndef SEC_E_MUST_BE_KDC -#define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L) -#endif -#ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED -#define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL) -#endif -#ifndef SEC_E_TOO_MANY_PRINCIPALS -#define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL) -#endif -#ifndef SEC_E_NO_PA_DATA -#define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL) -#endif -#ifndef SEC_E_PKINIT_NAME_MISMATCH -#define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL) -#endif -#ifndef SEC_E_SMARTCARD_LOGON_REQUIRED -#define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL) -#endif -#ifndef SEC_E_SHUTDOWN_IN_PROGRESS -#define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL) -#endif -#ifndef SEC_E_KDC_INVALID_REQUEST -#define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L) -#endif -#ifndef SEC_E_KDC_UNABLE_TO_REFER -#define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L) -#endif -#ifndef SEC_E_KDC_UNKNOWN_ETYPE -#define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L) -#endif -#ifndef SEC_E_UNSUPPORTED_PREAUTH -#define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L) -#endif -#ifndef SEC_E_DELEGATION_REQUIRED -#define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L) -#endif -#ifndef SEC_E_BAD_BINDINGS -#define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L) -#endif -#ifndef SEC_E_MULTIPLE_ACCOUNTS -#define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L) -#endif -#ifndef SEC_E_NO_KERB_KEY -#define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L) -#endif -#ifndef SEC_E_CERT_WRONG_USAGE -#define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L) -#endif -#ifndef SEC_E_DOWNGRADE_DETECTED -#define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L) -#endif -#ifndef SEC_E_SMARTCARD_CERT_REVOKED -#define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L) -#endif -#ifndef SEC_E_ISSUING_CA_UNTRUSTED -#define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L) -#endif -#ifndef SEC_E_REVOCATION_OFFLINE_C -#define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L) -#endif -#ifndef SEC_E_PKINIT_CLIENT_FAILURE -#define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L) -#endif -#ifndef SEC_E_SMARTCARD_CERT_EXPIRED -#define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L) -#endif -#ifndef SEC_E_NO_S4U_PROT_SUPPORT -#define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L) -#endif -#ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE -#define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L) -#endif -#ifndef SEC_E_REVOCATION_OFFLINE_KDC -#define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L) -#endif -#ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC -#define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L) -#endif -#ifndef SEC_E_KDC_CERT_EXPIRED -#define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL) -#endif -#ifndef SEC_E_KDC_CERT_REVOKED -#define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL) -#endif -#endif /* __MINGW32CE__ */ /* Offered by mingw-w64 v8+. MS SDK 6.0A+. */ #ifndef SEC_E_INVALID_PARAMETER #define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL) @@ -302,44 +83,11 @@ extern PSecurityFunctionTable Curl_pSecFn; #define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL) #endif -#ifdef __MINGW32CE__ -#ifndef SEC_I_CONTINUE_NEEDED -#define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L) -#endif -#ifndef SEC_I_COMPLETE_NEEDED -#define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L) -#endif -#ifndef SEC_I_COMPLETE_AND_CONTINUE -#define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L) -#endif -#ifndef SEC_I_LOCAL_LOGON -#define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L) -#endif -#ifndef SEC_I_CONTEXT_EXPIRED -#define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L) -#endif -#ifndef SEC_I_INCOMPLETE_CREDENTIALS -#define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L) -#endif -#ifndef SEC_I_RENEGOTIATE -#define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L) -#endif -#ifndef SEC_I_NO_LSA_CONTEXT -#define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L) -#endif -#endif /* __MINGW32CE__ */ - /* Offered by mingw-w64 v8+. MS SDK 6.0A+. */ #ifndef SEC_I_SIGNATURE_NEEDED #define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL) #endif -#ifdef __MINGW32CE__ -#ifndef CRYPT_E_NOT_IN_REVOCATION_DATABASE -#define CRYPT_E_NOT_IN_REVOCATION_DATABASE ((HRESULT)0x80092014L) -#endif -#endif /* __MINGW32CE__ */ - /* * Definitions required from ntsecapi.h are directly provided below this point * to avoid including ntsecapi.h due to a conflict with OpenSSL's safestack.h diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 68bfddddcb..a0308f06b2 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -69,7 +69,7 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T rc = pthread_create(t, NULL, curl_thread_create_thunk, ac); if(rc) { - CURL_SETERRNO(rc); + errno = rc; goto err; } @@ -109,10 +109,9 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T if(!t) { DWORD gle = GetLastError(); /* !checksrc! disable ERRNOVAR 1 */ - int err = (gle == ERROR_ACCESS_DENIED || - gle == ERROR_NOT_ENOUGH_MEMORY) ? - EACCES : EINVAL; - CURL_SETERRNO(err); + errno = (gle == ERROR_ACCESS_DENIED || + gle == ERROR_NOT_ENOUGH_MEMORY) ? + EACCES : EINVAL; return curl_thread_t_null; } return t; @@ -128,11 +127,7 @@ void Curl_thread_destroy(curl_thread_t *hnd) int Curl_thread_join(curl_thread_t *hnd) { -#ifdef UNDER_CE - int ret = (WaitForSingleObject(*hnd, INFINITE) == WAIT_OBJECT_0); -#else int ret = (WaitForSingleObjectEx(*hnd, INFINITE, FALSE) == WAIT_OBJECT_0); -#endif Curl_thread_destroy(hnd); diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index 9509e83148..a5311874b8 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -47,7 +47,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence) #endif } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 #include "multibyte.h" @@ -235,7 +235,7 @@ int curlx_win32_open(const char *filename, int oflag, ...) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; #else if(fix_excessive_path(filename, &fixed)) target = fixed; @@ -266,7 +266,7 @@ FILE *curlx_win32_fopen(const char *filename, const char *mode) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; curlx_unicodefree(filename_w); curlx_unicodefree(mode_w); #else @@ -304,7 +304,7 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) } else /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(EINVAL); + errno = EINVAL; #else if(fix_excessive_path(path, &fixed)) target = fixed; @@ -321,4 +321,4 @@ int curlx_win32_stat(const char *path, struct_stat *buffer) return result; } -#endif /* _WIN32 && !UNDER_CE */ +#endif /* _WIN32 */ diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index 51f4dbca17..da9eb55ec9 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -34,7 +34,7 @@ int curlx_fseek(void *stream, curl_off_t offset, int whence); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *curlx_win32_fopen(const char *filename, const char *mode); int curlx_win32_stat(const char *path, struct_stat *buffer); int curlx_win32_open(const char *filename, int oflag, ...); diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index a9595d0c2f..d4053f1a60 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -72,9 +72,9 @@ static char *inet_ntop4(const unsigned char *src, char *dst, size_t size) len = strlen(tmp); if(len == 0 || len >= size) { #ifdef USE_WINSOCK - CURL_SETERRNO(WSAEINVAL); + errno = WSAEINVAL; #else - CURL_SETERRNO(ENOSPC); + errno = ENOSPC; #endif return NULL; } @@ -186,9 +186,9 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size) */ if((size_t)(tp - tmp) > size) { #ifdef USE_WINSOCK - CURL_SETERRNO(WSAEINVAL); + errno = WSAEINVAL; #else - CURL_SETERRNO(ENOSPC); + errno = ENOSPC; #endif return NULL; } @@ -215,7 +215,7 @@ char *curlx_inet_ntop(int af, const void *src, char *buf, size_t size) case AF_INET6: return inet_ntop6((const unsigned char *)src, buf, size); default: - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return NULL; } } diff --git a/lib/curlx/inet_pton.c b/lib/curlx/inet_pton.c index d2b39ae9f1..b78fa5d746 100644 --- a/lib/curlx/inet_pton.c +++ b/lib/curlx/inet_pton.c @@ -82,7 +82,7 @@ curlx_inet_pton(int af, const char *src, void *dst) case AF_INET6: return inet_pton6(src, (unsigned char *)dst); default: - CURL_SETERRNO(SOCKEAFNOSUPPORT); + errno = SOCKEAFNOSUPPORT; return -1; } /* NOTREACHED */ diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index e5227554e5..047588ed18 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -287,13 +287,10 @@ const char *curlx_strerror(int err, char *buf, size_t buflen) *buf = '\0'; #ifdef _WIN32 -#ifndef UNDER_CE /* 'sys_nerr' is the maximum errno number, it is not widely portable */ if(err >= 0 && err < sys_nerr) SNPRINTF(buf, buflen, "%s", sys_errlist[err]); - else -#endif - { + else { if( #ifdef USE_WINSOCK !get_winsock_error(err, buf, buflen) && @@ -350,7 +347,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen) *p = '\0'; if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; #ifdef _WIN32 if(old_win_err != GetLastError()) diff --git a/lib/curlx/version_win32.c b/lib/curlx/version_win32.c index 7e415dfe89..cc86b71d3e 100644 --- a/lib/curlx/version_win32.c +++ b/lib/curlx/version_win32.c @@ -111,12 +111,6 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, /* we are always running on PLATFORM_WINNT */ matched = FALSE; } -#elif defined(UNDER_CE) - (void)majorVersion; - (void)minorVersion; - (void)buildVersion; - (void)platform; - (void)condition; #else ULONGLONG cm = 0; struct OUR_OSVERSIONINFOEXW osver; @@ -139,7 +133,7 @@ bool curlx_verify_windows_version(const unsigned int majorVersion, #pragma clang diagnostic ignored "-Wcast-function-type-strict" #endif pRtlVerifyVersionInfo = CURLX_FUNCTION_CAST(RTLVERIFYVERSIONINFO_FN, - GetProcAddress(GetModuleHandleA("ntdll"), "RtlVerifyVersionInfo")); + GetProcAddress(GetModuleHandle(TEXT("ntdll")), "RtlVerifyVersionInfo")); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop #endif diff --git a/lib/curlx/winapi.c b/lib/curlx/winapi.c index de1218cec7..2dc277c1c1 100644 --- a/lib/curlx/winapi.c +++ b/lib/curlx/winapi.c @@ -61,8 +61,7 @@ const char *curlx_get_winapi_error(DWORD err, char *buf, size_t buflen) /* We return the local codepage version of the error string because if it is output to the user's terminal it will likely be with functions which - expect the local codepage (eg fprintf, failf, infof). - FormatMessageW -> wcstombs is used for Windows CE compatibility. */ + expect the local codepage (eg fprintf, failf, infof). */ if(FormatMessageW((FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err, LANG_NEUTRAL, wbuf, CURL_ARRAYSIZE(wbuf), NULL)) { @@ -118,7 +117,7 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen) #endif if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; if(old_win_err != GetLastError()) SetLastError(old_win_err); diff --git a/lib/easy.c b/lib/easy.c index c5ccc5b1e6..54896a8d55 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -106,12 +106,10 @@ static curl_simple_lock s_lock = CURL_SIMPLE_LOCK_INIT; * ways, but at this point it must be defined as the system-supplied strdup * so the callback pointer is initialized correctly. */ -#ifdef UNDER_CE -#define system_strdup _strdup -#elif !defined(HAVE_STRDUP) -#define system_strdup Curl_strdup -#else +#ifdef HAVE_STRDUP #define system_strdup strdup +#else +#define system_strdup Curl_strdup #endif #if defined(_MSC_VER) && defined(_DLL) diff --git a/lib/file.c b/lib/file.c index 5656202834..5fff5d0a82 100644 --- a/lib/file.c +++ b/lib/file.c @@ -572,7 +572,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) if(data->state.resume_from) { if(!S_ISDIR(statbuf.st_mode)) { -#if defined(__AMIGA__) || defined(__MINGW32CE__) +#ifdef __AMIGA__ if(data->state.resume_from != lseek(fd, (off_t)data->state.resume_from, SEEK_SET)) #else diff --git a/lib/ftp.c b/lib/ftp.c index 108310bf30..bcf4b809cc 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3311,10 +3311,6 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, /* shut down the socket to inform the server we are done */ -#ifdef UNDER_CE - shutdown(conn->sock[SECONDARYSOCKET], 2); /* SD_BOTH */ -#endif - if(Curl_conn_is_setup(conn, SECONDARYSOCKET)) { if(!result && ftpc->dont_check && data->req.maxdownload > 0) { /* partial download completed */ diff --git a/lib/getenv.c b/lib/getenv.c index 3bfcf707a4..a2d8056fcc 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -31,7 +31,7 @@ static char *GetEnv(const char *variable) { -#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE) || \ +#if defined(CURL_WINDOWS_UWP) || \ defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */ (void)variable; return NULL; diff --git a/lib/hostip.c b/lib/hostip.c index ce79e5fc4b..48889dcb43 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -42,9 +42,7 @@ #endif #include -#ifndef UNDER_CE #include -#endif #include "urldata.h" #include "sendf.h" diff --git a/lib/md4.c b/lib/md4.c index d86a24628c..0cc62f8152 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -133,12 +133,7 @@ static int MD4_Init(MD4_CTX *ctx) static void MD4_Update(MD4_CTX *ctx, const void *data, unsigned long size) { -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data), - (unsigned int) size, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)data, (unsigned int) size, 0); -#endif } static void MD4_Final(unsigned char *result, MD4_CTX *ctx) diff --git a/lib/md5.c b/lib/md5.c index d99554a4aa..4b38bb070b 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -240,11 +240,7 @@ static void my_md5_update(void *in, unsigned int inputLen) { my_md5_ctx *ctx = in; -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(input), inputLen, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)input, inputLen, 0); -#endif } static void my_md5_final(unsigned char *digest, void *in) diff --git a/lib/memdebug.c b/lib/memdebug.c index 7ded52c1e9..11e924a55b 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -117,7 +117,7 @@ static bool countcheck(const char *func, int line, const char *source) source, line, func); fflush(curl_dbg_logfile); /* because it might crash now */ /* !checksrc! disable ERRNOVAR 1 */ - CURL_SETERRNO(ENOMEM); + errno = ENOMEM; return TRUE; /* RETURN ERROR! */ } else diff --git a/lib/rename.c b/lib/rename.c index 225811e65a..911afca575 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -39,7 +39,7 @@ /* return 0 on success, 1 on error */ int Curl_rename(const char *oldpath, const char *newpath) { -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* rename() on Windows does not overwrite, so we cannot use it here. MoveFileEx() will overwrite and is usually atomic, however it fails when there are open handles to the file. */ diff --git a/lib/sha256.c b/lib/sha256.c index f7bb545613..3e3205e36b 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -214,11 +214,7 @@ static void my_sha256_update(void *in, unsigned int length) { my_sha256_ctx *ctx = (my_sha256_ctx *)in; -#ifdef __MINGW32CE__ - CryptHashData(ctx->hHash, (BYTE *)CURL_UNCONST(data), length, 0); -#else CryptHashData(ctx->hHash, (const BYTE *)data, length, 0); -#endif } static void my_sha256_final(unsigned char *digest, void *in) diff --git a/lib/strerror.c b/lib/strerror.c index 5b82d7f965..afe69756bc 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -679,7 +679,7 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen) #endif if(errno != old_errno) - CURL_SETERRNO(old_errno); + errno = old_errno; #ifdef _WIN32 if(old_win_err != GetLastError()) diff --git a/lib/system_win32.c b/lib/system_win32.c index cd01fd2ebf..bdbed66162 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -99,15 +99,9 @@ CURLcode Curl_win32_init(long flags) s_hIpHlpApiDll = curl_load_library(TEXT("iphlpapi.dll")); if(s_hIpHlpApiDll) { /* Get the address of the if_nametoindex function */ -#ifdef UNDER_CE - #define CURL_TEXT(n) TEXT(n) -#else - #define CURL_TEXT(n) (n) -#endif IF_NAMETOINDEX_FN pIfNameToIndex = CURLX_FUNCTION_CAST(IF_NAMETOINDEX_FN, - GetProcAddress(s_hIpHlpApiDll, - CURL_TEXT("if_nametoindex"))); + GetProcAddress(s_hIpHlpApiDll, "if_nametoindex")); if(pIfNameToIndex) Curl_if_nametoindex = pIfNameToIndex; @@ -164,13 +158,9 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD); /* See function definitions in winbase.h */ #ifdef UNICODE -# ifdef UNDER_CE -# define LOADLIBARYEX L"LoadLibraryExW" -# else -# define LOADLIBARYEX "LoadLibraryExW" -# endif +# define LOADLIBARYEX "LoadLibraryExW" #else -# define LOADLIBARYEX "LoadLibraryExA" +# define LOADLIBARYEX "LoadLibraryExA" #endif /* @@ -189,7 +179,7 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD); */ static HMODULE curl_load_library(LPCTSTR filename) { -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP HMODULE hModule = NULL; LOADLIBRARYEX_FN pLoadLibraryEx = NULL; diff --git a/lib/transfer.c b/lib/transfer.c index 4c17cbb50d..2b06566f73 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -39,9 +39,7 @@ #ifdef HAVE_SYS_IOCTL_H #include #endif -#ifndef UNDER_CE #include -#endif #ifdef HAVE_SYS_PARAM_H #include diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index f2a907cb09..6311f4a416 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -119,12 +119,6 @@ #define CALG_SHA_256 0x0000800c #endif -/* Work around typo in CeGCC (as of 0.59.1) w32api headers */ -#if defined(__MINGW32CE__) && \ - !defined(ALG_CLASS_DHASH) && defined(ALG_CLASS_HASH) -#define ALG_CLASS_DHASH ALG_CLASS_HASH -#endif - /* Offered by mingw-w64 v4+. MS SDK 6.0A+. */ #ifndef PKCS12_NO_PERSIST_KEY #define PKCS12_NO_PERSIST_KEY 0x00008000 @@ -385,7 +379,6 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, return CURLE_OK; } -#ifndef UNDER_CE /* Function allocates memory for store_path only if CURLE_OK is returned */ static CURLcode get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, @@ -441,7 +434,6 @@ get_cert_location(TCHAR *path, DWORD *store_name, TCHAR **store_path, return CURLE_OK; } -#endif static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf, @@ -536,7 +528,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, return CURLE_SSL_CONNECT_ERROR; } -#ifndef UNDER_CE /* client certificate */ if(data->set.ssl.primary.clientcert || data->set.ssl.primary.cert_blob) { DWORD cert_store_name = 0; @@ -744,7 +735,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf, } client_cert_store = cert_store; } -#endif /* allocate memory for the reusable credential handle */ backend->cred = (struct Curl_schannel_cred *) @@ -875,9 +865,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) struct ssl_connect_data *connssl = cf->ctx; struct schannel_ssl_backend_data *backend = (struct schannel_ssl_backend_data *)connssl->backend; -#ifndef UNDER_CE struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); -#endif struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); SecBuffer outbuf; SecBufferDesc outbuf_desc; @@ -908,11 +896,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) backend->use_alpn = FALSE; #endif -#ifdef UNDER_CE - /* certificate validation on Windows CE does not seem to work right; we will - * do it following a more manual process. */ - backend->use_manual_cred_validation = TRUE; -#else if(conn_config->CAfile || conn_config->ca_info_blob) { if(curlx_verify_windows_version(6, 1, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL)) { @@ -926,7 +909,6 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) } else backend->use_manual_cred_validation = FALSE; -#endif backend->cred = NULL; @@ -2573,7 +2555,7 @@ static void schannel_close(struct Curl_cfilter *cf, struct Curl_easy *data) static int schannel_init(void) { -#if defined(HAS_ALPN_SCHANNEL) && !defined(UNDER_CE) +#ifdef HAS_ALPN_SCHANNEL typedef const char *(APIENTRY *WINE_GET_VERSION_FN)(void); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic push @@ -2581,8 +2563,7 @@ static int schannel_init(void) #endif WINE_GET_VERSION_FN p_wine_get_version = CURLX_FUNCTION_CAST(WINE_GET_VERSION_FN, - GetProcAddress(GetModuleHandleA("ntdll"), - "wine_get_version")); + GetProcAddress(GetModuleHandle(TEXT("ntdll")), "wine_get_version")); #if defined(__clang__) && __clang_major__ >= 16 #pragma clang diagnostic pop #endif @@ -2599,7 +2580,7 @@ static int schannel_init(void) s_win_has_alpn = curlx_verify_windows_version(6, 3, 0, PLATFORM_WINNT, VERSION_GREATER_THAN_EQUAL); } -#endif /* HAS_ALPN_SCHANNEL && !UNDER_CE */ +#endif /* HAS_ALPN_SCHANNEL */ return Curl_sspi_global_init() == CURLE_OK ? 1 : 0; } @@ -2716,12 +2697,7 @@ static void schannel_checksum(const unsigned char *input, if(!CryptCreateHash(hProv, algId, 0, 0, &hHash)) break; /* failed */ -#ifdef __MINGW32CE__ - /* workaround for CeGCC, should be (const BYTE*) */ - if(!CryptHashData(hHash, (BYTE*)CURL_UNCONST(input), (DWORD)inputlen, 0)) -#else if(!CryptHashData(hHash, input, (DWORD)inputlen, 0)) -#endif break; /* failed */ /* get hash size */ diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index a508494484..6b8aec5613 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -55,22 +55,6 @@ #define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend) -#ifdef __MINGW32CE__ -#define CERT_QUERY_OBJECT_BLOB 0x00000002 -#define CERT_QUERY_CONTENT_CERT 1 -#define CERT_QUERY_CONTENT_FLAG_CERT (1 << CERT_QUERY_CONTENT_CERT) -#define CERT_QUERY_FORMAT_BINARY 1 -#define CERT_QUERY_FORMAT_BASE64_ENCODED 2 -#define CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED 3 -#define CERT_QUERY_FORMAT_FLAG_ALL \ - (1 << CERT_QUERY_FORMAT_BINARY) | \ - (1 << CERT_QUERY_FORMAT_BASE64_ENCODED) | \ - (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED) -#define CERT_CHAIN_REVOCATION_CHECK_CHAIN 0x20000000 -#define CERT_NAME_DISABLE_IE4_UTF8_FLAG 0x00010000 -#define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000 -#endif /* __MINGW32CE__ */ - #define MAX_CAFILE_SIZE 1048576 /* 1 MiB */ #define BEGIN_CERT "-----BEGIN CERTIFICATE-----" #define END_CERT "\n-----END CERTIFICATE-----" @@ -112,7 +96,6 @@ struct cert_chain_engine_config_win7 { HCERTSTORE hExclusiveTrustedPeople; }; -#ifndef UNDER_CE static int is_cr_or_lf(char c) { return c == '\r' || c == '\n'; @@ -534,7 +517,6 @@ static bool get_alt_name_info(struct Curl_easy *data, result = TRUE; return result; } -#endif /* !UNDER_CE */ /* Verify the server's hostname */ CURLcode Curl_verify_host(struct Curl_cfilter *cf, @@ -543,58 +525,6 @@ CURLcode Curl_verify_host(struct Curl_cfilter *cf, CURLcode result = CURLE_PEER_FAILED_VERIFICATION; struct ssl_connect_data *connssl = cf->ctx; CERT_CONTEXT *pCertContextServer = NULL; -#ifdef UNDER_CE - TCHAR cert_hostname_buff[256]; - DWORD len; - - /* This code does not support certificates with multiple alternative names. - * Right now we are only asking for the first preferred alternative name. - * Instead we would need to do all via CERT_NAME_SEARCH_ALL_NAMES_FLAG - * (If Windows CE supports that?) and run this section in a loop for each. - * https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetnamestringa - * curl: (51) schannel: CertGetNameString() certificate hostname - * (.google.com) did not match connection (google.com) - */ - len = CertGetNameString(pCertContextServer, - CERT_NAME_DNS_TYPE, - CERT_NAME_DISABLE_IE4_UTF8_FLAG, - NULL, - cert_hostname_buff, - 256); - if(len > 0) { - /* Comparing the cert name and the connection hostname encoded as UTF-8 - * is acceptable since both values are assumed to use ASCII - * (or some equivalent) encoding - */ - char *cert_hostname = curlx_convert_tchar_to_UTF8(cert_hostname_buff); - if(!cert_hostname) { - result = CURLE_OUT_OF_MEMORY; - } - else{ - const char *conn_hostname = connssl->peer.hostname; - if(Curl_cert_hostcheck(cert_hostname, strlen(cert_hostname), - conn_hostname, strlen(conn_hostname))) { - infof(data, - "schannel: connection hostname (%s) validated " - "against certificate name (%s)", - conn_hostname, cert_hostname); - result = CURLE_OK; - } - else{ - failf(data, - "schannel: connection hostname (%s) " - "does not match certificate name (%s)", - conn_hostname, cert_hostname); - } - Curl_safefree(cert_hostname); - } - } - else { - failf(data, - "schannel: CertGetNameString did not provide any " - "certificate name information"); - } -#else SECURITY_STATUS sspi_status; TCHAR *cert_hostname_buff = NULL; size_t cert_hostname_buff_index = 0; @@ -740,7 +670,6 @@ cleanup: if(pCertContextServer) CertFreeCertificateContext(pCertContextServer); -#endif /* !UNDER_CE */ return result; } @@ -757,10 +686,8 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, CERT_CONTEXT *pCertContextServer = NULL; const CERT_CHAIN_CONTEXT *pChainContext = NULL; HCERTCHAINENGINE cert_chain_engine = NULL; -#ifndef UNDER_CE HCERTSTORE trust_store = NULL; HCERTSTORE own_trust_store = NULL; -#endif /* !UNDER_CE */ DEBUGASSERT(BACKEND); @@ -776,7 +703,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, result = CURLE_PEER_FAILED_VERIFICATION; } -#ifndef UNDER_CE if(result == CURLE_OK && (conn_config->CAfile || conn_config->ca_info_blob) && BACKEND->use_manual_cred_validation) { @@ -870,7 +796,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, } } } -#endif /* !UNDER_CE */ if(result == CURLE_OK) { CERT_CHAIN_PARA ChainPara; @@ -934,7 +859,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, } } -#ifndef UNDER_CE if(cert_chain_engine) { CertFreeCertificateChainEngine(cert_chain_engine); } @@ -942,7 +866,6 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, if(own_trust_store) { CertCloseStore(own_trust_store, 0); } -#endif /* !UNDER_CE */ if(pChainContext) CertFreeCertificateChain(pChainContext); diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index b9abc6e3fa..328b12403e 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -386,10 +386,7 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, * valid when used in another process with different CWD. However, * when a path does not exist, this does not work. Then, we add * the path as is. */ -#ifdef UNDER_CE - (void)is_local; - return curlx_dyn_addf(buf, ":%s-%s", name, path); -#elif defined(_WIN32) +#ifdef _WIN32 char abspath[_MAX_PATH]; if(_fullpath(abspath, path, _MAX_PATH)) return curlx_dyn_addf(buf, ":%s-%s", name, abspath); diff --git a/m4/xc-lt-iface.m4 b/m4/xc-lt-iface.m4 index a408800353..22eecd349f 100644 --- a/m4/xc-lt-iface.m4 +++ b/m4/xc-lt-iface.m4 @@ -74,7 +74,7 @@ fi if test "x$xc_lt_want_enable_shared" = 'xyes' && test "x$xc_lt_want_enable_static" = 'xyes'; then case $host_os in @%:@ ( - cegcc* | os2* | aix*) + os2* | aix*) xc_lt_want_enable_static='no' ;; esac @@ -265,7 +265,7 @@ elif test "x$allow_undefined_flag" = 'xunsupported'; then xc_lt_shlib_use_no_undefined='yes' fi case $host_os in @%:@ ( - cygwin* | mingw* | cegcc* | os2* | aix*) + cygwin* | mingw* | os2* | aix*) xc_lt_shlib_use_no_undefined='yes' ;; esac diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a70c96b765..9e2bbed8f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,7 +121,7 @@ if(CURL_HAS_LTO) set_target_properties(${EXE_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) endif() -if(ENABLE_UNICODE AND MINGW AND NOT MINGW32CE) +if(ENABLE_UNICODE AND MINGW) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_OPTIONS "-municode") else() diff --git a/src/terminal.c b/src/terminal.c index 014e2df8c0..867ca6edcf 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -64,7 +64,7 @@ unsigned int get_terminal_columns(void) struct winsize ts; if(!ioctl(STDIN_FILENO, TIOCGWINSZ, &ts)) cols = (int)ts.ws_col; -#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#elif defined(_WIN32) && !defined(CURL_WINDOWS_UWP) { HANDLE stderr_hnd = GetStdHandle(STD_ERROR_HANDLE); CONSOLE_SCREEN_BUFFER_INFO console_info; diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 2ea8801705..d4431a74b9 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -156,7 +156,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) /* * Truncate the etag save stream, it can have an existing etag value. */ -#if defined(HAVE_FTRUNCATE) && !defined(__MINGW32CE__) +#ifdef HAVE_FTRUNCATE if(ftruncate(fileno(etag_save->stream), 0)) { return CURL_WRITEFUNC_ERROR; } diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 6c119047ce..cc7ef5a550 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -122,11 +122,11 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) On Linux per->infd should be stdin (0) and the block below should not execute */ if(per->uploadfile && !strcmp(per->uploadfile, ".") && per->infd > 0) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) rc = CURL_RECV(per->infd, buffer, curlx_uztosi(sz * nmemb), 0); if(rc < 0) { if(SOCKERRNO == SOCKEWOULDBLOCK) { - CURL_SETERRNO(0); + errno = 0; config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } @@ -142,7 +142,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) rc = read(per->infd, buffer, sz*nmemb); if(rc < 0) { if(errno == EAGAIN) { - CURL_SETERRNO(0); + errno = 0; config->readbusy = TRUE; return CURL_READFUNC_PAUSE; } diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c index 292da1c251..fd1b4c563c 100644 --- a/src/tool_cb_see.c +++ b/src/tool_cb_see.c @@ -78,7 +78,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) } #endif -#if defined(__AMIGA__) || defined(__MINGW32CE__) +#ifdef __AMIGA__ if(LSEEK_ERROR == lseek(per->infd, (off_t)offset, whence)) #else if(LSEEK_ERROR == lseek(per->infd, offset, whence)) diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index 724706b7a1..48f5fea3c9 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -109,7 +109,7 @@ bool tool_create_output_file(struct OutStruct *outs, return TRUE; } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 static size_t win_console(intptr_t fhnd, struct OutStruct *outs, char *buffer, size_t bytes, size_t *retp) @@ -247,7 +247,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) struct OperationConfig *config = per->config; size_t bytes = sz * nmemb; bool is_tty = global->isatty; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 CONSOLE_SCREEN_BUFFER_INFO console_info; intptr_t fhnd; #endif @@ -321,7 +321,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) } } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 fhnd = _get_osfhandle(fileno(outs->stream)); /* if Windows console then UTF-8 must be converted to UTF-16 */ if(isatty(fileno(outs->stream)) && diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index 29d5ecc782..2ddb0ad2fc 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -261,7 +261,7 @@ static void free_globalconfig(void) global->trace_stream = NULL; tool_safefree(global->libcurl); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 free(global->term.buf); #endif } diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index cac22483b7..dc78f2db44 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -326,7 +326,7 @@ struct OperationConfig { BIT(skip_existing); }; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 struct termout { wchar_t *buf; DWORD len; @@ -343,7 +343,7 @@ struct GlobalConfig { struct OperationConfig *first; struct OperationConfig *current; struct OperationConfig *last; -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 struct termout term; #endif timediff_t ms_per_transfer; /* start next transfer after (at least) this diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index 91cc1b60cb..17b2d01e9b 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -23,8 +23,8 @@ ***************************************************************************/ #include "tool_setup.h" -#if defined(_WIN32) && !defined(UNDER_CE) -# include +#ifdef _WIN32 +#include #endif #include "tool_dirhie.h" diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 2b19a163ce..6204296a8b 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -561,7 +561,7 @@ char **__crt0_glob_function(char *arg) #ifdef _WIN32 -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ +#if !defined(CURL_WINDOWS_UWP) && \ !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) /* Search and set the CA cert file for Windows. * @@ -613,7 +613,7 @@ CURLcode FindWin32CACert(struct OperationConfig *config, struct curl_slist *GetLoadedModulePaths(void) { struct curl_slist *slist = NULL; -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP HANDLE hnd = INVALID_HANDLE_VALUE; MODULEENTRY32 mod = {0}; @@ -664,7 +664,7 @@ cleanup: bool tool_term_has_bold; -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP /* The terminal settings to restore on exit */ static struct TerminalSettings { HANDLE hStdOut; @@ -735,14 +735,14 @@ static void init_terminal(void) CURLcode win32_init(void) { curlx_now_init(); -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP init_terminal(); #endif return CURLE_OK; } -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP /* The following STDIN non - blocking read techniques are heavily inspired by nmap and ncat (https://nmap.org/ncat/) */ struct win_thread_data { @@ -949,7 +949,7 @@ curl_socket_t win32_stdin_read_thread(void) return socket_r; } -#endif /* !CURL_WINDOWS_UWP && !UNDER_CE */ +#endif /* !CURL_WINDOWS_UWP */ #endif /* _WIN32 */ diff --git a/src/tool_doswin.h b/src/tool_doswin.h index 7fe5260476..01500bdbf7 100644 --- a/src/tool_doswin.h +++ b/src/tool_doswin.h @@ -47,7 +47,7 @@ char **__crt0_glob_function(char *arg); #ifdef _WIN32 -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ +#if !defined(CURL_WINDOWS_UWP) && \ !defined(CURL_DISABLE_CA_SEARCH) && !defined(CURL_CA_SEARCH_SAFE) CURLcode FindWin32CACert(struct OperationConfig *config, const TCHAR *bundle_file); @@ -55,9 +55,9 @@ CURLcode FindWin32CACert(struct OperationConfig *config, struct curl_slist *GetLoadedModulePaths(void); CURLcode win32_init(void); -#if !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#ifndef CURL_WINDOWS_UWP curl_socket_t win32_stdin_read_thread(void); -#endif /* !CURL_WINDOWS_UWP && !UNDER_CE */ +#endif #endif /* _WIN32 */ diff --git a/src/tool_formparse.c b/src/tool_formparse.c index 1d127a5842..c1e9abe9d0 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -121,11 +121,7 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent, } } else { /* Standard input. */ -#ifdef UNDER_CE - int fd = STDIN_FILENO; -#else int fd = fileno(stdin); -#endif char *data = NULL; curl_off_t size; curl_off_t origin; diff --git a/src/tool_getparam.h b/src/tool_getparam.h index 6b37cc50eb..d5ef54a81d 100644 --- a/src/tool_getparam.h +++ b/src/tool_getparam.h @@ -379,7 +379,7 @@ void parse_cert_parameter(const char *cert_parameter, ParameterError parse_args(int argc, argv_item_t argv[]); -#if defined(UNICODE) && defined(_WIN32) && !defined(UNDER_CE) +#if defined(UNICODE) && defined(_WIN32) #define convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr)) #define convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr)) diff --git a/src/tool_getpass.c b/src/tool_getpass.c index a4dea347ef..014c22813a 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -42,7 +42,7 @@ # include iodef #endif -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 # include #endif @@ -115,7 +115,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) return buffer; /* we always return success */ } #define DONE -#endif /* _WIN32 && !UNDER_CE */ +#endif /* _WIN32 */ #ifndef DONE /* not previously provided */ diff --git a/src/tool_main.c b/src/tool_main.c index 4e70c1081c..8df63ef05a 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -27,9 +27,7 @@ #include #endif -#ifndef UNDER_CE #include -#endif #ifdef HAVE_FCNTL_H #include @@ -143,7 +141,7 @@ static void memory_tracking_init(void) /* ** curl tool main function. */ -#if defined(_UNICODE) && !defined(UNDER_CE) +#ifdef _UNICODE #if defined(__GNUC__) || defined(__clang__) /* GCC does not know about wmain() */ #pragma GCC diagnostic push @@ -159,7 +157,7 @@ int main(int argc, char *argv[]) tool_init_stderr(); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 /* Undocumented diagnostic option to list the full paths of all loaded modules. This is purposely pre-init. */ if(argc == 2 && !_tcscmp(argv[1], _T("--dump-module-paths"))) { @@ -169,8 +167,7 @@ int main(int argc, char *argv[]) curl_slist_free_all(head); return head ? 0 : 1; } -#endif -#ifdef _WIN32 + /* win32_init must be called before other init routines. */ result = win32_init(); if(result) { @@ -214,7 +211,7 @@ int main(int argc, char *argv[]) #endif } -#if defined(_UNICODE) && !defined(UNDER_CE) +#ifdef _UNICODE #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop #endif diff --git a/src/tool_operate.c b/src/tool_operate.c index b7c8805b3a..8949ce2a52 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -555,25 +555,19 @@ static CURLcode retrycheck(struct OperationConfig *config, } if(truncate && outs->bytes && outs->filename && outs->stream) { -#ifndef __MINGW32CE__ struct_stat fileinfo; /* The output can be a named pipe or a character device etc that cannot be truncated. Only truncate regular files. */ if(!fstat(fileno(outs->stream), &fileinfo) && - S_ISREG(fileinfo.st_mode)) -#else - /* Windows CE's fileno() is bad so just skip the check */ -#endif - { + S_ISREG(fileinfo.st_mode)) { int rc; /* We have written data to an output file, we truncate file */ fflush(outs->stream); notef("Throwing away %" CURL_FORMAT_CURL_OFF_T " bytes", outs->bytes); /* truncate file at the position where we started appending */ -#if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__) && \ - !defined(__MINGW32CE__) +#if defined(HAVE_FTRUNCATE) && !defined(__DJGPP__) && !defined(__AMIGA__) if(ftruncate(fileno(outs->stream), outs->init)) { /* when truncate fails, we cannot just append as then we will create something strange, bail out */ @@ -625,7 +619,7 @@ static CURLcode post_per_transfer(struct per_transfer *per, if(per->uploadfile) { if(!strcmp(per->uploadfile, ".") && per->infd > 0) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) sclose(per->infd); #else warnf("Closing per->infd != 0: FD == " @@ -1122,7 +1116,7 @@ static void check_stdin_upload(struct OperationConfig *config, CURLX_SET_BINMODE(stdin); if(!strcmp(per->uploadfile, ".")) { -#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) +#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) /* non-blocking stdin behavior on Windows is challenging Spawn a new thread that will read from stdin and write out to a socket */ @@ -2100,8 +2094,7 @@ static CURLcode cacertpaths(struct OperationConfig *config) goto fail; } } -#elif !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE) && \ - !defined(CURL_DISABLE_CA_SEARCH) +#elif !defined(CURL_WINDOWS_UWP) && !defined(CURL_DISABLE_CA_SEARCH) result = FindWin32CACert(config, TEXT("curl-ca-bundle.crt")); if(result) goto fail; @@ -2234,11 +2227,8 @@ CURLcode operate(int argc, argv_item_t argv[]) { CURLcode result = CURLE_OK; const char *first_arg; -#ifdef UNDER_CE - first_arg = argc > 1 ? strdup(argv[1]) : NULL; -#else + first_arg = argc > 1 ? convert_tchar_to_UTF8(argv[1]) : NULL; -#endif #ifdef HAVE_SETLOCALE /* Override locale for number parsing (only) */ diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 46096d5b5a..5fce4e24d1 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -100,7 +100,7 @@ ParameterError parseconfig(const char *filename, int max_recursive) } filename = pathalloc = curlrc; } -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 else { char *fullp; /* check for .curlrc then _curlrc in the directory of the executable */ diff --git a/src/tool_setup.h b/src/tool_setup.h index a661040737..17c2f420b5 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -93,15 +93,6 @@ extern FILE *tool_stderr; /* set in init_terminal() */ extern bool tool_term_has_bold; -#ifdef UNDER_CE -# undef isatty -# define isatty(fd) 0 /* fd is void*, expects int */ -# undef _get_osfhandle -# define _get_osfhandle(fd) (fd) -# undef _getch -# define _getch() 0 -#endif - #ifndef HAVE_FTRUNCATE int tool_ftruncate64(int fd, curl_off_t where); diff --git a/src/tool_util.c b/src/tool_util.c index f8415d2a17..a2798876ea 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -80,17 +80,9 @@ int struplocompare4sort(const void *p1, const void *p2) } #ifdef USE_TOOL_FTRUNCATE - -#ifdef UNDER_CE -/* 64-bit lseek-like function unavailable */ -# undef _lseeki64 -# define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence) -#endif - /* * Truncate a file handle at a 64-bit position 'where'. */ - int tool_ftruncate64(int fd, curl_off_t where) { intptr_t handle = _get_osfhandle(fd); @@ -103,10 +95,9 @@ int tool_ftruncate64(int fd, curl_off_t where) return 0; } - #endif /* USE_TOOL_FTRUNCATE */ -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *tool_execpath(const char *filename, char **pathp) { static char filebuffer[512]; diff --git a/src/tool_util.h b/src/tool_util.h index c97c1c03c2..12206ce980 100644 --- a/src/tool_util.h +++ b/src/tool_util.h @@ -34,7 +34,7 @@ struct timeval tvrealnow(void); int struplocompare(const char *p1, const char *p2); int struplocompare4sort(const void *p1, const void *p2); -#if defined(_WIN32) && !defined(UNDER_CE) +#ifdef _WIN32 FILE *tool_execpath(const char *filename, char **pathp); #endif diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c index b4f7702851..88cbdd8a44 100644 --- a/tests/libtest/lib505.c +++ b/tests/libtest/lib505.c @@ -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", diff --git a/tests/libtest/lib525.c b/tests/libtest/lib525.c index 4c33973ec9..292dd59f21 100644 --- a/tests/libtest/lib525.c +++ b/tests/libtest/lib525.c @@ -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", diff --git a/tests/libtest/lib541.c b/tests/libtest/lib541.c index dfe585d9da..8a2b76f8d0 100644 --- a/tests/libtest/lib541.c +++ b/tests/libtest/lib541.c @@ -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", diff --git a/tests/libtest/lib556.c b/tests/libtest/lib556.c index 78b89975e8..daf92fe1e6 100644 --- a/tests/libtest/lib556.c +++ b/tests/libtest/lib556.c @@ -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))); diff --git a/tests/libtest/lib582.c b/tests/libtest/lib582.c index e013daedff..9601f29c71 100644 --- a/tests/libtest/lib582.c +++ b/tests/libtest/lib582.c @@ -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", diff --git a/tests/server/first.h b/tests/server/first.h index 3a7255ccb8..fc581487e6 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -48,9 +48,7 @@ struct entry_s { extern const struct entry_s s_entries[]; -#ifndef UNDER_CE #include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 7320fa6fe9..b4896260b9 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -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[]) diff --git a/tests/server/util.c b/tests/server/util.c index 6de8000327..afe6986263 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -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)) { -- 2.47.3