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

Add handling for MSGPACK_OBJECT_FLOAT{32,64} #6406

Merged
merged 4 commits into from Mar 31, 2017

Conversation

jamessan
Copy link
Member

@jamessan jamessan commented Mar 30, 2017

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

@jamessan
Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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.

@justinmk
Copy link
Member

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.
@jamessan jamessan merged commit 1097ba5 into neovim:master Mar 31, 2017
@jamessan jamessan deleted the msgpack-c-2.1.x-compat branch March 31, 2017 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants