-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
windows: bump minimum to Vista (from XP) #18009
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
Draft
vszakats
wants to merge
33
commits into
curl:master
Choose a base branch
from
vszakats:vista
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+273
−712
Conversation
This file contains hidden or 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
9b136f3
to
f0b639c
Compare
vszakats
added a commit
that referenced
this pull request
Jul 24, 2025
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jul 24, 2025
Seen with a non-unity, mingw-w64 CI job targeting a Vista+ Windows version while working on a PR. This combination is not normally tested in CI. Fixing: ``` In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0, from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17, from D:/a/curl/curl/lib/url.c:63: D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB' CERT_NAME_BLOB *certificateNames; ^~~~~~~~~~~~~~ D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB' CRYPT_HASH_BLOB certBlob; ^~~~~~~~~~~~~~~ ``` Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140 Follow-up to 0d71b18 curl#17413 Ref: curl#18009
3 tasks
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jul 24, 2025
Seen with a non-unity, mingw-w64 CI job targeting a Vista+ Windows version while working on a PR. This combination is not normally tested in CI. Fixing: ``` In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0, from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17, from D:/a/curl/curl/lib/url.c:63: D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB' CERT_NAME_BLOB *certificateNames; ^~~~~~~~~~~~~~ D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB' CRYPT_HASH_BLOB certBlob; ^~~~~~~~~~~~~~~ ``` Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140 Follow-up to 0d71b18 curl#17413 Ref: curl#18009
vszakats
added a commit
that referenced
this pull request
Jul 24, 2025
Required for mingw-w64 5.x (and older) builds targeting a Windows 7+. mingw-w64 6+ fixed `mprapi.h` (included indirectly via `iphlpapi.h`) to include `wincrypt.h` for the missing types. MSVC is not affected because SDK 7.1a (the oldest MS SDK curl supports), `mprapi.h` does include `wincrypt.h`. Make sure to include `wincrypt.h` before including `iphlpapi.h` as a workaround. `wincrypt.h` is used unconditionally even though it's not available in UWP. This is safe in this context, because we use `iphlpapi.h` for `if_nametoindex`, which is not supported and used in UWP builds. This fixes auto-detection that missed detecting `if_nametoindex` in the affected combination, and this build error in non-unity builds: ``` In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0, from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17, from D:/a/curl/curl/lib/url.c:63: D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB' CERT_NAME_BLOB *certificateNames; ^~~~~~~~~~~~~~ D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB' CRYPT_HASH_BLOB certBlob; ^~~~~~~~~~~~~~~ ``` Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140 This combination is not normally tested in CI. It was caught in the `dl-mingw, CM 6.4.0-i686 schannel !unity Win7` job while working on another PR. Follow-up to 0d71b18 #17413 Ref: #18009 Closes #18012
8c9ff31
to
5410661
Compare
a87bd89
to
4c0a94f
Compare
vszakats
added a commit
that referenced
this pull request
Jul 27, 2025
Collision happens when building with mingw-w64 v3 or v2 while targeting Vista or newer. `iphlpapi.h` includes `windns.h` in this case, which defines macros named `DNS_TYPE_*`, colliding with curl doh enums. The issue was fixed in mingw-w64 v4: mirror/mingw-w64@ea95d55 Fixes: ``` lib/doh.h:54:3: error: expected identifier before numeric constant DNS_TYPE_A = 1, ^ ``` Ref: https://github.com/curl/curl/actions/runs/16551209676/job/46806303365?pr=18009#step:10:17 This workaround seems harmless and generally good practice, but another option is to require mingw-w64 v4. Ref: #18009 Closes #18041
7db8996
to
20cfc9e
Compare
by default 7.3.0 and 6.4.0 build for _WIN32_WINNT=0x0502 https://github.com/curl/curl/actions/runs/16485731656/job/46609964506?pr=18009
use CURL_TARGET_WINDOWS_VERSION.
UWP builds don't support iphlpapi's if_nametoindex(). ``` D:/a/curl/curl/lib/url.c: In function 'zonefrom_url': D:/a/curl/curl/lib/url.c:1777:55: error: unused parameter 'data' [-Werror=unused-parameter] 1777 | static void zonefrom_url(CURLU *uh, struct Curl_easy *data, | ~~~~~~~~~~~~~~~~~~^~~~ ``` ``` C:\a\curl\curl\lib\url.c(1777,55): warning C4100: 'data': unreferenced parameter [C:\a\curl\curl\bld\lib\libcurl_object.vcxproj] ```
…ista mingw-w64 v5.x and older defaults to 0x0502 (WS2003) mingw-w64 v6 v7 v8 defaults to 0x0502 (WS2003) by default mingw-w64 v9.x and later (as of v13) defaults to 0x0a00 (Win10) by default
Present in all supported toolchains (VS2008+, mingw-w64), but requires targeting XP SP2+.
Part of the OS, there is no way to use another version than the minimum shipping with Vista.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CI
Continuous Integration
feature-window
A merge of this requires an open feature window
Windows
Windows-specific
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.
After this patch curl requires targeting Vista or newer, and a toolchain
with Vista support.
Supported MSVC compilers (VS2010+) all support Vista:
Supported mingw-w64 versions (v3+) all support Vista:
(v6+ allows changing the default at toolchain build-time)
Notes:
if_nametoindex
needs to beallowlisted in
curl_setup.h
, if they do support it.Fixes #17985
w/o ws https://github.com/curl/curl/pull/18009/files?w=1
easy_lock.h
.CALG_SHA_256
. (present in all supported toolchains, but requires targeting XP SP2+)schannel.c
/struct algo
? May be worth a try, but probably not._WIN32_WINNT
when using old mingw-w64 versions? (within cmake, autotools, to apply to feature checks)config-win32.h
tocurl_setup.h
? (it's still needed for VS2010, and also for mingw-w64)HAVE_ATOMIC
,HAVE_STDATOMIC_H
. Consider deleting logic dealing with them under Windows. (e.g. pre-fill)Targeting Windows 7 (instead of Vista) as a minimum, would save 20
lines more and two runtime version checks in Schannel. I think it's fine
to keep supporting Vista.