Skip to content

Commit

Permalink
THRIFT-5816 Fix UUID for boost 1.86.0 (change in {{data}} member usage)
Browse files Browse the repository at this point in the history
client: cpp
Patch: Carel Combrink

This closes #3035
  • Loading branch information
CJCombrink authored and Jens-G committed Sep 4, 2024
1 parent 449442e commit 3867d68
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/c_glib/test/testthrifttestclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class TestHandler : public ThriftTestIf {
out = thing;
}

std::string testUuid(const std::string thing) override {
cout << "[C -> C++] testUuid(\"" << std::hex << thing << "\")" << '\n';
apache::thrift::TUuid testUuid(const apache::thrift::TUuid thing) override {
cout << "[C -> C++] testUuid(\"" << thing << "\")" << '\n';
return thing;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/c_glib/test/testthrifttestzlibclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class TestHandler : public ThriftTestIf {
out = thing;
}

std::string testUuid(const std::string thing) override {
cout << "[C -> C++] testUuid(\"" << std::hex << thing << "\")" << '\n';
apache::thrift::TUuid testUuid(const apache::thrift::TUuid thing) override {
cout << "[C -> C++] testUuid(\"" << thing << "\")" << '\n';
return thing;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/TUuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TUuid::TUuid(const std::string& str) noexcept {
}

try {
const boost::uuids::uuid uuid{gen(str)};
const boost::uuids::uuid uuid = gen(str);
std::copy(uuid.begin(), uuid.end(), this->begin());
} catch (const std::runtime_error&) {
// Invalid string most probably
Expand Down
2 changes: 1 addition & 1 deletion lib/cpp/src/thrift/TUuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TUuid {
#endif // THRIFT_TUUID_BOOST_CONSTRUCTOR_EXPLICIT
TUuid(const boost::uuids::uuid& buuid) noexcept
{
std::copy(std::begin(buuid.data), std::end(buuid.data), std::begin(this->data_));
std::copy(buuid.begin(), buuid.end(), std::begin(this->data_));
}
#endif // THRIFT_TUUID_SUPPORT_BOOST_UUID

Expand Down
4 changes: 2 additions & 2 deletions lib/cpp/test/TUuidTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(into_boost_uuid) {

BOOST_AUTO_TEST_CASE(from_boost_uuid) {
static boost::uuids::string_generator gen;
boost::uuids::uuid boost_uuid{gen("1f610073-db33-4d21-adf2-75460d4955cc")};
boost::uuids::uuid boost_uuid = gen("1f610073-db33-4d21-adf2-75460d4955cc");
BOOST_TEST(!boost_uuid.is_nil());
TUuid uuid;
BOOST_TEST(uuid.is_nil());
Expand Down Expand Up @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(test_character_buffer) {
BOOST_AUTO_TEST_CASE(test_boost_buffer) {

static boost::uuids::string_generator gen;
boost::uuids::uuid boost_uuid{gen("1f610073-db33-4d21-adf2-75460d4955cc")};
boost::uuids::uuid boost_uuid = gen("1f610073-db33-4d21-adf2-75460d4955cc");
BOOST_TEST(!boost_uuid.is_nil());

const TUuid uuid{boost_uuid.data};
Expand Down

0 comments on commit 3867d68

Please sign in to comment.