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
Add handling for MSGPACK_OBJECT_FLOAT{32,64} #6406
Conversation
An alternative route here would be to replace the use of msgpack-c with libmpack, but we would still need to handle receiving float32 types from other users of the API. |
@@ -973,7 +973,13 @@ int msgpack_to_vim(const msgpack_object mobj, typval_T *const rettv) | |||
} | |||
break; | |||
} | |||
case MSGPACK_OBJECT_FLOAT: { | |||
#ifdef NVIM_MSGPACK_HAS_FLOAT32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we test MSGPACK_VERSION_*
instead? https://github.com/msgpack/msgpack-c/blob/master/include/msgpack/version.h
That also avoids the extra cmake code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally prefer "feature" checks instead of version checks. It's not as relevant here, but they're more robust in terms of changes being backported.
Looks like gcc on ubuntu 12 (quickbuild) doesn't build with this version of msgpack. |
msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a 64-bit value. Now, 32-bit and 64-bit floats are supported as distinct types, but we'll simply continue to treat everything as 64-bit types.
922b6c4
to
193aa4c
Compare
msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a float64
value. Now, float32 and float64 are supported as distinct types,
but we'll simply continue to treat everything as float64.
There is an issue with using "nvim built against msgpack-c < 2.1.0" with
a msgpack-c >= 2.1.0 shared library, since nvim won't recognize a packed
MSGPACK_OBJECT_FLOAT32. I expect this to be handled by distributions (I
ran into it while trying to updated Debian's msgpack-c), but I still
wanted to raise the issue.
Cc @ZyX-I