Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: simplify detecting and using system headers #12495

wants to merge 27 commits into from


Copy link

@vszakats vszakats commented Dec 9, 2023

  • 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: 2748c64
  • cmake: delete unused variable signature_call_conv since
  • 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

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).

Closes #12495


@vszakats vszakats added build Windows Windows-specific tidy-up labels Dec 9, 2023
@vszakats vszakats marked this pull request as draft December 9, 2023 23:29
@vszakats vszakats marked this pull request as ready for review December 10, 2023 02:30
@vszakats vszakats changed the title windows: cleanup/dedupe detecting/using system/socket headers windows: simplify detecting and using system headers Dec 10, 2023
It seems like this was a mistake, as it contradicts the original
commit message in 2748c64. These
headers exist in a mingw32ce release from 2009. Though the commit
predates that by 1 year, it seems unlikely these weren't present
in earlier releases.
These are always available for _WIN32, no need keeping a tab of them.
Use existing USE_WINSOCK to decide if we actually want to use the
default Windows TCP/IP stack.
@vszakats vszakats closed this in c1bc090 Dec 16, 2023
@vszakats vszakats deleted the winguards branch December 16, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Successfully merging this pull request may close these issues.

None yet

2 participants