mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
deps: Update to the experimental msgpack v5 branch
Using msgpack v5 will let nvim be more compatible with msgpack libraries for other platforms. This also replaces "raw" references by "bin" which is the new name for msgpack binary data type
This commit is contained in:
parent
042aca6eb4
commit
e2143674ae
@ -24,13 +24,13 @@ find_path(MSGPACK_INCLUDE_DIR msgpack.h
|
||||
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
|
||||
${LIMIT_SEARCH})
|
||||
|
||||
# If we're asked to use static linkage, add libmsgpackc.a as a preferred library name.
|
||||
# If we're asked to use static linkage, add libmsgpack.a as a preferred library name.
|
||||
if(MSGPACK_USE_STATIC)
|
||||
list(APPEND MSGPACK_NAMES
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
list(APPEND MSGPACK_NAMES msgpackc)
|
||||
list(APPEND MSGPACK_NAMES msgpack)
|
||||
|
||||
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
|
||||
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
|
||||
|
@ -277,9 +277,9 @@ Object msgpack_rpc_dispatch(uint64_t channel_id,
|
||||
msgpack_object method = req->via.array.ptr[2];
|
||||
uint64_t method_id = method.via.u64;
|
||||
|
||||
if (method.type == MSGPACK_OBJECT_RAW) {
|
||||
if (method.type == MSGPACK_OBJECT_BIN) {
|
||||
char method_name[]]..(max_fname_len + 1)..[[];
|
||||
xstrlcpy(method_name, method.via.raw.ptr, min(method.via.raw.size, ]] ..(max_fname_len)..[[) + 1);
|
||||
xstrlcpy(method_name, method.via.bin.ptr, min(method.via.bin.size, ]] ..(max_fname_len)..[[) + 1);
|
||||
method_id = map_get(cstr_t, uint64_t)(rpc_method_ids, method_name);
|
||||
if (!method_id) {
|
||||
method_id = UINT64_MAX;
|
||||
|
@ -109,8 +109,8 @@ void msgpack_rpc_error(char *msg, msgpack_packer *res)
|
||||
size_t len = strlen(msg);
|
||||
|
||||
// error message
|
||||
msgpack_pack_raw(res, len);
|
||||
msgpack_pack_raw_body(res, msg, len);
|
||||
msgpack_pack_bin(res, len);
|
||||
msgpack_pack_bin_body(res, msg, len);
|
||||
// Nil result
|
||||
msgpack_pack_nil(res);
|
||||
}
|
||||
@ -132,8 +132,8 @@ WBuffer *serialize_request(uint64_t request_id,
|
||||
msgpack_pack_uint64(&pac, request_id);
|
||||
}
|
||||
|
||||
msgpack_pack_raw(&pac, method.size);
|
||||
msgpack_pack_raw_body(&pac, method.data, method.size);
|
||||
msgpack_pack_bin(&pac, method.size);
|
||||
msgpack_pack_bin_body(&pac, method.data, method.size);
|
||||
msgpack_rpc_from_array(args, &pac);
|
||||
WBuffer *rv = wstream_new_buffer(xmemdup(sbuffer->data, sbuffer->size),
|
||||
sbuffer->size,
|
||||
@ -160,8 +160,8 @@ WBuffer *serialize_response(uint64_t response_id,
|
||||
if (err_msg) {
|
||||
String err = {.size = strlen(err_msg), .data = err_msg};
|
||||
// error message
|
||||
msgpack_pack_raw(&pac, err.size);
|
||||
msgpack_pack_raw_body(&pac, err.data, err.size);
|
||||
msgpack_pack_bin(&pac, err.size);
|
||||
msgpack_pack_bin_body(&pac, err.data, err.size);
|
||||
// Nil result
|
||||
msgpack_pack_nil(&pac);
|
||||
} else {
|
||||
@ -195,8 +195,8 @@ WBuffer *serialize_metadata(uint64_t id,
|
||||
// The result is the [channel_id, metadata] array
|
||||
msgpack_pack_array(&pac, 2);
|
||||
msgpack_pack_uint64(&pac, channel_id);
|
||||
msgpack_pack_raw(&pac, msgpack_metadata_size);
|
||||
msgpack_pack_raw_body(&pac, msgpack_metadata, msgpack_metadata_size);
|
||||
msgpack_pack_bin(&pac, msgpack_metadata_size);
|
||||
msgpack_pack_bin_body(&pac, msgpack_metadata, msgpack_metadata_size);
|
||||
WBuffer *rv = wstream_new_buffer(xmemdup(sbuffer->data, sbuffer->size),
|
||||
sbuffer->size,
|
||||
1,
|
||||
@ -235,7 +235,7 @@ static char *msgpack_rpc_validate(uint64_t *response_id, msgpack_object *req)
|
||||
}
|
||||
|
||||
if (req->via.array.ptr[2].type != MSGPACK_OBJECT_POSITIVE_INTEGER
|
||||
&& req->via.array.ptr[2].type != MSGPACK_OBJECT_RAW) {
|
||||
&& req->via.array.ptr[2].type != MSGPACK_OBJECT_BIN) {
|
||||
return "Method must be a positive integer or a string";
|
||||
}
|
||||
|
||||
|
@ -81,12 +81,12 @@ bool msgpack_rpc_to_float(msgpack_object *obj, Float *arg)
|
||||
|
||||
bool msgpack_rpc_to_string(msgpack_object *obj, String *arg)
|
||||
{
|
||||
if (obj->type != MSGPACK_OBJECT_RAW) {
|
||||
if (obj->type != MSGPACK_OBJECT_BIN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
arg->data = xmemdupz(obj->via.raw.ptr, obj->via.raw.size);
|
||||
arg->size = obj->via.raw.size;
|
||||
arg->data = xmemdupz(obj->via.bin.ptr, obj->via.bin.size);
|
||||
arg->size = obj->via.bin.size;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ bool msgpack_rpc_to_object(msgpack_object *obj, Object *arg)
|
||||
arg->type = kObjectTypeFloat;
|
||||
return msgpack_rpc_to_float(obj, &arg->data.floating);
|
||||
|
||||
case MSGPACK_OBJECT_RAW:
|
||||
case MSGPACK_OBJECT_BIN:
|
||||
arg->type = kObjectTypeString;
|
||||
return msgpack_rpc_to_string(obj, &arg->data.string);
|
||||
|
||||
@ -200,8 +200,8 @@ void msgpack_rpc_from_float(Float result, msgpack_packer *res)
|
||||
|
||||
void msgpack_rpc_from_string(String result, msgpack_packer *res)
|
||||
{
|
||||
msgpack_pack_raw(res, result.size);
|
||||
msgpack_pack_raw_body(res, result.data, result.size);
|
||||
msgpack_pack_bin(res, result.size);
|
||||
msgpack_pack_bin_body(res, result.data, result.size);
|
||||
}
|
||||
|
||||
void msgpack_rpc_from_object(Object result, msgpack_packer *res)
|
||||
|
19
third-party/CMakeLists.txt
vendored
19
third-party/CMakeLists.txt
vendored
@ -50,8 +50,8 @@ include(ExternalProject)
|
||||
set(LIBUV_URL https://github.com/joyent/libuv/archive/v0.11.28.tar.gz)
|
||||
set(LIBUV_MD5 1a849ba4fc571d531482ed74bc7aabc4)
|
||||
|
||||
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/releases/download/cpp-0.5.8/msgpack-0.5.8.tar.gz)
|
||||
set(MSGPACK_MD5 ea0bee0939d2980c0df91f0e4843ccc4)
|
||||
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/0335df55e1a408c0d56d43e46253c952fb8a7f04.tar.gz)
|
||||
set(MSGPACK_MD5 4c18a1625b586c0d69a0e955ce9a187f)
|
||||
|
||||
set(LUAJIT_URL http://luajit.org/download/LuaJIT-2.0.3.tar.gz)
|
||||
set(LUAJIT_MD5 f14e9104be513913810cd59c8c658dc0)
|
||||
@ -92,9 +92,18 @@ if(USE_BUNDLED_MSGPACK)
|
||||
-DEXPECTED_MD5=${MSGPACK_MD5}
|
||||
-DTARGET=msgpack
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
|
||||
CONFIGURE_COMMAND ${DEPS_BUILD_DIR}/src/msgpack/configure --disable-shared
|
||||
--with-pic --prefix=${DEPS_INSTALL_DIR} CC=${DEPS_C_COMPILER}
|
||||
INSTALL_COMMAND ${MAKE_PRG} install)
|
||||
CONFIGURE_COMMAND cmake ${DEPS_BUILD_DIR}/src/msgpack
|
||||
-DMSGPACK_ENABLE_CXX=OFF
|
||||
-DMSGPACK_BUILD_TESTS=OFF
|
||||
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_COMPILER_ARG1} -fPIC"
|
||||
BUILD_COMMAND ${MAKE_PRG}
|
||||
INSTALL_COMMAND ${MAKE_PRG} install &&
|
||||
rm ${DEPS_INSTALL_DIR}/lib/libmsgpack.so &&
|
||||
rm ${DEPS_INSTALL_DIR}/lib/libmsgpack.so.3 &&
|
||||
rm ${DEPS_INSTALL_DIR}/lib/libmsgpack.so.4.0.0
|
||||
)
|
||||
list(APPEND THIRD_PARTY_DEPS msgpack)
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user