-
-
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
examples: fix compiling with MSVC #13771
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
``` curl\docs\examples\externalsocket.c(125,32): error C2220: the following warning is treated as an error [curl\bld\docs\examples\curl-example-externalsocket.vcxproj] curl\docs\examples\externalsocket.c(125,32): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [curl\bld\docs\examples\curl-example-externalsocket.vcxproj] ``` Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:95
``` curl\docs\examples\multi-legacy.c(152,1): error C2220: the following warning is treated as an error [curl\bld\docs\examples\curl-example-multi-legacy.vcxproj] curl\docs\examples\multi-legacy.c(152,1): warning C4706: assignment within conditional expression [curl\bld\docs\examples\curl-example-multi-legacy.vcxproj] ``` Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:226
MarcelRaad
reviewed
May 25, 2024
Also drop winsock2 include. `curl/curl.h` already includes it.
MarcelRaad
approved these changes
May 25, 2024
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
May 25, 2024
Cherry-picked from curl#13771 Closes #xxxxx
vszakats
added a commit
that referenced
this pull request
May 27, 2024
Continuing the theme, add 3 MSVC jobs with tests, matching configurations used on AppVeyor. MSVC versions are identical: 19.39.33523.0 + Windows SDK 10.0.22621.0. Also enable websockets, and build examples. Tests are run in parallel (`-j14`), with improved performance. Job performance: ``` AppVeyor GHA w/examples -------- ---------- CMake, VS2022, Debug, x64, Schannel, Static, Unicode 38m 4s 11m57s CMake, VS2022, Debug, x64, no SSL, Static 35m15s 12m 6s CMake, VS2022, Debug, x64, no SSL, Static, HTTP only 25m25s 10m36s ``` Based on these runs: https://ci.appveyor.com/project/curlorg/curl/builds/49884748 https://github.com/curl/curl/actions/runs/9229448468 This is the first time examples are built in CI with MSVC: Fix all warnings and errors that came up via d4b8589 #13771. Closes #13766
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.
websocket.c
: useSleep()
on Windows.sleep()
andunistd.h
are not available in MSVC.http2-upload.c
: use localgettimeofday()
implementationwhen compiled with MSVC.
(Alternate solution is to disable the trace function for MSVC.)
Public domain code copied and adapted from libssh2:
https://github.com/libssh2/libssh2/blob/e973493f992313b3be73f51d3f7ca6d52e288558/src/misc.c#L719-L743
silence compiler warning for deprecated
inet_addr()
.Also drop duplicate winsock2 include.
Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:95
silence an MSVC compiler warning. This is in conflict with
checksrc
rules, so silence the rule in favour of thewarning-free C syntax.
Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:226
do not use
sys/time.h
andunistd.h
in Windows builds.Some of these includes look unnecessary. Subject to another
PR.
Cherry-picked from #13766
Closes #13771