From 39449936865996145f52c593b7f029b9d7f703eb Mon Sep 17 00:00:00 2001 From: Daniil Kovalev Date: Sat, 8 May 2021 16:26:25 +0300 Subject: [PATCH] Fix name conflicts Previously `struct iovec` was explicitly defined on non-Unix systems, which caused name conflicts when other libraries (e.g. Cyrus SASL) did the same. Using `struct iovec` as `msgpack::iovec` solves the problem. --- include/msgpack/v1/vrefbuffer.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/msgpack/v1/vrefbuffer.hpp b/include/msgpack/v1/vrefbuffer.hpp index 0f1e215a..1768eef2 100644 --- a/include/msgpack/v1/vrefbuffer.hpp +++ b/include/msgpack/v1/vrefbuffer.hpp @@ -26,11 +26,16 @@ #if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) #include +namespace msgpack { +typedef ::iovec iovec; +} // namespace msgpack #else +namespace msgpack { struct iovec { void *iov_base; size_t iov_len; }; +} // namespace msgpack #endif namespace msgpack { @@ -183,7 +188,7 @@ public: } } - const struct iovec* vector() const + const iovec* vector() const { return m_array; }