Repository navigation
Conversation
By moving the coexist workaround from vtls/openssl.c to vtls/openssl.h.
This way it also applies to vtls.c (and possibly other sources including
`vtls/openssl.h`), which may need it before including BoringSSL header
`openssl/ssl.h` pulling in the conflicting symbols and causing conflicts
otherwise.
Example build:
```
-DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30
```
Fixing:
```
In file included from _cm-win-boringssl/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:7:
In file included from lib/vtls/vtls.c:54:
In file included from lib/vtls/openssl.h:33:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/opensslv.h:18:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/crypto.h:18:
/path/to/boringssl/_x64-win-ucrt/usr/include/openssl/base.h:293:29: error: expected ')'
293 | typedef struct X509_name_st X509_NAME;
| ^
/path/to/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
1515 | #define X509_NAME ((LPCSTR) 7)
| ^
```
Ref: 2a92c39 curl#20567
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
By moving the coexist workaround from vtls/openssl.c to vtls/openssl.h.
This way it also applies to vtls.c (and possibly other sources including
`vtls/openssl.h`), which may need it in unity builds before BoringSSL
header `openssl/ssl.h` pulling in the conflicting symbols and causing
conflicts otherwise.
Seen with build config:
```
-DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30
```
Fixing:
```
In file included from _cm-win-boringssl/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:7:
In file included from lib/vtls/vtls.c:54:
In file included from lib/vtls/openssl.h:33:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/opensslv.h:18:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/crypto.h:18:
/path/to/boringssl/_x64-win-ucrt/usr/include/openssl/base.h:293:29: error: expected ')'
293 | typedef struct X509_name_st X509_NAME;
| ^
/path/to/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
1515 | #define X509_NAME ((LPCSTR) 7)
| ^
[...]
```
Ref: 2a92c39 curl#20567
Closes curl#21136
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Nov 18, 2026
After recent changes to crypto/hash use, openssl headers can be included
earlier than before, earlier than the conflict mitigation previously put
into `lib/vtls/openssl.h`. This broke some build configurations.
Move the conflict mitigation as up to the global headers as possible to
make it effective again, hopefully fixing this for good.
Seen in curl-for-win dev builds with OpenSSL in win-llvm:
```
In file included from curl-for-win/curl/_x64-win-ucrt-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_4_c.c:22:
In file included from curl-for-win/curl/lib/vauth/digest.c:36:
In file included from curl-for-win/curl/lib/curl_sha512_256.h:41:
In file included from curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/opensslv.h:7:
In file included from curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/crypto.h:7:
curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/base.h:335:29: error: expected ')'
335 | typedef struct X509_name_st X509_NAME;
| ^
curl-for-win/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
1515 | #define X509_NAME ((LPCSTR) 7)
| ^
```
Ref: https://github.com/curl/curl-for-win/actions/runs/44300799917/job/134789709975#step:3:5085
Follow-up to ff18b24 curl#23497
Follow-up to f0f0a7f curl#21136
vszakats
added a commit
that referenced
this pull request
Nov 18, 2026
After recent changes to crypto/hash use, openssl headers can be included
earlier than before, earlier than the conflict mitigation previously put
into `lib/vtls/openssl.h`. This broke some build configurations.
Move the conflict mitigation as up to the global headers as possible to
make it effective again, hopefully fixing this for good.
Seen in curl-for-win dev builds with OpenSSL in win-llvm:
```
In file included from curl-for-win/curl/_x64-win-ucrt-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_4_c.c:22:
In file included from curl-for-win/curl/lib/vauth/digest.c:36:
In file included from curl-for-win/curl/lib/curl_sha512_256.h:41:
In file included from curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/opensslv.h:7:
In file included from curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/crypto.h:7:
curl-for-win/awslc/_x64-win-ucrt/usr/include/openssl/base.h:335:29: error: expected ')'
335 | typedef struct X509_name_st X509_NAME;
| ^
curl-for-win/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
1515 | #define X509_NAME ((LPCSTR) 7)
| ^
```
Ref: https://github.com/curl/curl-for-win/actions/runs/44300799917/job/134789709975#step:3:5085
Follow-up to ff18b24 #23497
Follow-up to f0f0a7f #21136
Closes #24036
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
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.
By moving the coexist workaround from vtls/openssl.c to vtls/openssl.h.
This way it also applies to vtls.c (and possibly other sources including
vtls/openssl.h), which may need it in unity builds before BoringSSLheader
openssl/ssl.hpulling in the conflicting symbols and causingconflicts otherwise.
Seen with build config:
Fixing:
Ref: 2a92c39 #20567