]> git.ipfire.org Git - thirdparty/curl.git/commit
windows: simplify detecting and using system headers
authorViktor Szakats <commit@vsz.me>
Sat, 9 Dec 2023 20:37:11 +0000 (20:37 +0000)
committerViktor Szakats <commit@vsz.me>
Sat, 16 Dec 2023 13:13:44 +0000 (13:13 +0000)
commitc1bc090d65b8d7d14e811dd36f5e8674be43dff3
treed4828f8cee97ae9b600f4d08517fc787e1f561d6
parent3829759bd042c03225ae862062560f568ba1a231
windows: simplify detecting and using system headers

- autotools, cmake: assume that if we detect Windows, `windows.h`,
  `winsock2.h` and `ws2tcpip.h` do exist.
- lib: fix 3 outlier `#if` conditions to use `USE_WINSOCK` instead of
  looking for `winsock2.h`.
- autotools: merge 3 Windows check methods into one.
- move Watt-32 and lwIP socket support to `setup-win32.h` from
  `config-win32.h`. It opens up using these with all build tools. Also
  merge logic with Windows Sockets.
- fix to assume Windows sockets with the mingw32ce toolchain.
  Follow-up to: 2748c64d605b19fb419ae56810ad8da36487a2d4
- cmake: delete unused variable `signature_call_conv` since
  eb33ccd5332435fa50f1758e5debb869c6942b7f.
- autotools: simplify `CURL_CHECK_WIN32_LARGEFILE` detection.
- examples/externalsocket: fix header order.
- cmake/OtherTests.cmake: delete Windows-specific `_source_epilogue`
  that wasn't used anymore.
- cmake/OtherTests.cmake: set `WIN32_LEAN_AND_MEAN` for test
  `SIZEOF_STRUCT_SOCKADDR_STORAGE`.

After this patch curl universally uses `_WIN32` to guard
Windows-specific logic. It guards Windows Sockets-specific logic with
`USE_WINSOCK` (this might need further work).

Reviewed-by: Jay Satiro
Closes #12495
15 files changed:
CMake/CurlTests.c
CMake/OtherTests.cmake
CMakeLists.txt
acinclude.m4
configure.ac
docs/examples/externalsocket.c
lib/cf-socket.c
lib/config-win32.h
lib/config-win32ce.h
lib/curl_config.h.cmake
lib/curl_setup.h
lib/inet_pton.h
lib/setup-win32.h
m4/curl-compilers.m4
m4/curl-functions.m4