]> git.ipfire.org Git - thirdparty/curl.git/commit
build: tidy up and simplify `setmode()` detection and use master
authorViktor Szakats <commit@vsz.me>
Sat, 7 Feb 2026 16:57:39 +0000 (17:57 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 8 Feb 2026 14:47:47 +0000 (15:47 +0100)
commitcdfc8dc7ad2e573dcfc08f2c5a0a67910ef9c0a6
tree7122da4a9809d27c93beaa0889c3bda0f60bc5f9
parent2c0019b08554a5386b515752a783e7eb7182eec8
build: tidy up and simplify `setmode()` detection and use

- move macro to `curl_setup.h` (from curlx), and rename.
  It's required by src, test servers, libtests. Also used by unit/tunit,
  (which is fixable but this patch doesn't touch it.)
- special-case it for Windows/Cygwin/MS-DOS.
- build: drop `setmode()`/`_setmode()` detection.
  This also avoids detecting the different `setmode()` on BSDs,
  and a lot of complexity and overhead.
- use `CURL_O_BINARY`.

Follow-up to 250d613763dfc29f73010696ee7948f19d07dba9 #15787
Follow-up to 5e70566094463b8463d4dc1bec9b66763a761c76 #15169

Closes #20539
19 files changed:
CMake/unix-cache.cmake
CMake/win32-cache.cmake
CMakeLists.txt
acinclude.m4
configure.ac
lib/Makefile.inc
lib/config-win32.h
lib/curl_config-cmake.h.in
lib/curl_setup.h
lib/curlx/binmode.h [deleted file]
lib/curlx/curlx.h
src/Makefile.inc
src/tool_formparse.c
src/tool_getparam.c
src/tool_operate.c
tests/libtest/first.c
tests/server/mqttd.c
tests/server/sockfilt.c
tests/server/socksd.c