Skip to content

doh: rename symbols to avoid collision with mingw-w64 headers#18041

Closed
vszakats wants to merge 2 commits intocurl:masterfrom
vszakats:dns-type-mingw
Closed

doh: rename symbols to avoid collision with mingw-w64 headers#18041
vszakats wants to merge 2 commits intocurl:masterfrom
vszakats:dns-type-mingw

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented 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

It happens when building against mingw-w64 v3 or older 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.
@github-actions github-actions bot added the name lookup DNS and related tech label Jul 27, 2025
@vszakats vszakats added the build label Jul 27, 2025
@vszakats vszakats marked this pull request as draft July 27, 2025 13:16
@github-actions github-actions bot added the tests label Jul 27, 2025
@vszakats vszakats marked this pull request as ready for review July 27, 2025 13:20
@vszakats vszakats closed this in 08f97cb Jul 27, 2025
@vszakats vszakats deleted the dns-type-mingw branch July 27, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build name lookup DNS and related tech tests

Development

Successfully merging this pull request may close these issues.

2 participants