Skip to content
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

fixed cpp build error with adapters/libhv.h #1125

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

mtdxc
Copy link
Contributor

@mtdxc mtdxc commented Oct 24, 2022

small fixed when include dapters/libhv.h in cpp files in vs2017:

error C2664: “void redisAsyncHandleTimeout(redisAsyncContext *)”: 无法将参数 1 从“void *”转换为“redisAsyncContext *”

Copy link
Contributor

@bjosv bjosv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but interesting with the difference..

Tested it in our CI as well (which uses VS2022) where in C /Wall works fine, but building
our example-libhv example using C++ it gives:

"D:\a\hiredis\hiredis\examples\example-libhv.vcxproj" (default target) (5) ->
(ClCompile target) -> 
  D:\a\hiredis\hiredis\adapters/libhv.h(59,48): error C2664: 'void redisAsyncHandleTimeout(redisAsyncContext *)': cannot convert argument 1 from 'void *' to 'redisAsyncContext *' [D:\a\hiredis\hiredis\examples\example-libhv.vcxproj]
  D:\a\hiredis\hiredis\adapters/libhv.h(97,40): error C2440: '=': cannot convert from 'void *' to 'redisLibhvEvents *' [D:\a\hiredis\hiredis\examples\example-libhv.vcxproj]```

@michael-grunder michael-grunder merged commit ceb8a88 into redis:master Oct 24, 2022
@michael-grunder
Copy link
Collaborator

Tested it in our CI as well (which uses VS2022) where in C /Wall works fine, but building
our example-libhv example using C++ it gives:

Yeah, I always forget about C++'s explicit typecast requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants