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
tree: d4828f8cee97ae9b600f4d08517fc787e1f561d6
  1. .circleci/
  2. .github/
  3. .reuse/
  4. CMake/
  5. docs/
  6. include/
  7. lib/
  8. LICENSES/
  9. m4/
  10. packages/
  11. plan9/
  12. projects/
  13. scripts/
  14. src/
  15. tests/
  16. winbuild/
  17. .azure-pipelines.yml
  18. .cirrus.yml
  19. .dcignore
  20. .dir-locals.el
  21. .git-blame-ignore-revs
  22. .gitattributes
  23. .gitignore
  24. .mailmap
  25. acinclude.m4
  26. appveyor.yml
  27. buildconf
  28. buildconf.bat
  29. CHANGES
  30. CMakeLists.txt
  31. configure.ac
  32. COPYING
  33. curl-config.in
  34. GIT-INFO
  35. libcurl.def
  36. libcurl.pc.in
  37. MacOSX-Framework
  38. Makefile.am
  39. Makefile.dist
  40. maketgz
  41. README
  42. README.md
  43. RELEASE-NOTES
  44. SECURITY.md
README.md

curl logo

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. Find out how to install Curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl.3 man page to learn how.

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms.

Contact

If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Git

To download the latest source from the Git server, do this:

git clone https://github.com/curl/curl.git

(you will get a directory named curl created, filled with the source code)

Security problems

Report suspected security problems via our HackerOne page and not in public.

Notice

Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers! 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.