-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
jay
approved these changes
Dec 13, 2023
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 8, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 8, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 8, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 9, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 9, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 10, 2025
Almost all feature detection results are pre-filled on Windows for performance, so none of the issues fixed here affected builds. But, for good measure, this patch add missing detections and fixes others to make sure they work even when omitting the pre-fill. - fix `HAVE_STRUCT_TIMEVAL` detection for MSVC. Follow-up to c1bc090 curl#12495 - add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows. - fix `HAVE_STRDUP` detection for MSVC. - fix `HAVE_SNPRINTF` detection for Windows. Regression from 8e34505 curl#15164 - fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC. - exclude `if_nametoindex` detection for Windows. Although it exists on Windows, detection, usage and availability is complicated, and curl doesn't use it on this platform. Regression from 8e34505 curl#15164 Also: - move IPv6-related detections so that pre-filling applies to them. - add debug option to test without pre-filling. - fix compiler warnings happening in feature detections to reduce log noise. (uninitialized/unused variables, missing static, missing const, constant conditional, macro redef, OpenSSL 3 deprecation warning.) Closes curl#16278
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 10, 2025
Follow-up to c1bc090 curl#12495
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 11, 2025
Almost all feature detection results are pre-filled on Windows for performance, so none of the issues fixed here affected builds. But, for good measure, this patch add missing detections and fixes others to make sure they work even when omitting the pre-fill. - fix `HAVE_STRUCT_TIMEVAL` detection for MSVC. Follow-up to c1bc090 curl#12495 - add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows. - fix `HAVE_STRDUP` detection for MSVC. - fix `HAVE_SNPRINTF` detection for Windows. Regression from 8e34505 curl#15164 - fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC. - exclude `if_nametoindex` detection for Windows. Although it exists on Windows, detection, usage and availability is complicated, and curl doesn't use it on this platform. Regression from 8e34505 curl#15164 Also: - move IPv6 detections so that pre-filling applies to them. - add debug option to test without pre-filling. - replace `NOT LESS` with `GREATER_EQUAL` Closes curl#16278
vszakats
added a commit
that referenced
this pull request
Feb 11, 2025
Almost all feature detection results are pre-filled on Windows for performance, so none of the issues fixed here affected builds. For good measure, this patch add missing detections and fixes others to make sure they work even when omitting the pre-fill. It also fixes detecting IPv6 for MS-DOS. - fix `HAVE_STRUCT_TIMEVAL` detection for MSVC. Follow-up to c1bc090 #12495 - add `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection for Windows. - fix `HAVE_STRDUP` detection for MSVC. - fix `HAVE_SNPRINTF` detection for Windows. Regression from 8e34505 #15164 - fix `HAVE_IOCTLSOCKET` detection for non-UWP MSVC. - exclude `if_nametoindex` detection for Windows. Although it exists on Windows, detection, usage and availability is complicated, and curl doesn't use it on this platform. Regression from 8e34505 #15164 - move IPv6 detections so that pre-filling and MS-DOS Watt-32 configuration applies to them. This fixes `HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID` detection with MS-DOS. Ref: https://github.com/curl/curl/actions/runs/13260511764/job/37015877585#step:7:306 Follow-up to a3585c9 #15543 Also: - add debug option to test without pre-filling. - replace `NOT LESS` with `GREATER_EQUAL` Closes #16278
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
windows.h
,winsock2.h
andws2tcpip.h
do exist.#if
conditions to useUSE_WINSOCK
instead oflooking for
winsock2.h
.setup-win32.h
fromconfig-win32.h
. It opens up using these with all build tools. Alsomerge logic with Windows Sockets.
Follow-up to: 2748c64
signature_call_conv
sinceeb33ccd.
CURL_CHECK_WIN32_LARGEFILE
detection._source_epilogue
that wasn't used anymore.
WIN32_LEAN_AND_MEAN
for testSIZEOF_STRUCT_SOCKADDR_STORAGE
.After this patch curl universally uses
_WIN32
to guardWindows-specific logic. It guards Windows Sockets-specific logic with
USE_WINSOCK
(this might need further work).Closes #12495
TODO:
CURL_CHECK_NATIVE_WINDOWS
detection logic with_WIN32
.lib/setup-win32.h
vs.include/curl/system.h
. [→ system.h: sync mingwCURL_TYPEOF_CURL_SOCKLEN_T
with other compilers #12501]CURL_PULL_WS2TCPIP_H
is necessary. [→ build: remove redundantCURL_PULL_*
settings #12502]https://github.com/curl/curl/pull/12495/files?w=1