# HG changeset patch # User Alain Mazy # Date 1727162802 -7200 # Node ID 16df205057106f4246107cfe45710e56324007e8 # Parent 2854418a7c0d52d124b385576a21bf7c1ab60308 fix build for boost 1.86 diff -r 2854418a7c0d -r 16df20505710 OrthancFramework/Sources/Toolbox.cpp --- a/OrthancFramework/Sources/Toolbox.cpp Fri Sep 20 16:05:04 2024 +0200 +++ b/OrthancFramework/Sources/Toolbox.cpp Tue Sep 24 09:26:42 2024 +0200 @@ -801,7 +801,6 @@ return result; } - void Toolbox::ComputeSHA1(std::string& result, const void* data, size_t size) @@ -814,11 +813,13 @@ } unsigned int digest[5]; - // Sanity check for the memory layout: A SHA-1 digest is 160 bits wide - assert(sizeof(unsigned int) == 4 && sizeof(digest) == (160 / 8)); + assert(sizeof(unsigned int) == 4 && sizeof(digest) == (160 / 8)); + assert(sizeof(boost::uuids::detail::sha1::digest_type) == 20); - sha1.get_digest(digest); + // From Boost 1.86, digest_type is "unsigned char[20]" while it was "unsigned int[5]"" in previous versions. + // Always perform the cast even if it is useless for Boost < 1.86 + sha1.get_digest(*(reinterpret_cast(digest))); result.resize(8 * 5 + 4); sprintf(&result[0], "%08x-%08x-%08x-%08x-%08x",