tkurbad-overlay/sci-electronics/kicad/files/kicad-8.0.5-boost-1.86.patch
2024-11-05 12:51:21 +01:00

50 lines
1.8 KiB
Diff

diff '--color=auto' -ur kicad-8.0.5.orig/3d-viewer/3d_cache/3d_cache.cpp kicad-8.0.5/3d-viewer/3d_cache/3d_cache.cpp
--- kicad-8.0.5.orig/3d-viewer/3d_cache/3d_cache.cpp 2024-09-06 18:28:40.000000000 +0200
+++ kicad-8.0.5/3d-viewer/3d_cache/3d_cache.cpp 2024-11-05 11:40:58.773367999 +0100
@@ -381,7 +381,13 @@
fclose( fp );
unsigned int digest[5];
- dblock.get_digest( digest );
+ // V8 only
+ // Boost 1.86 and later changed digest_type from uchar[20] from int[5]
+ // But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
+ // this going for another few months.
+ static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
+ "SHA1 digest size mismatch" );
+ dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
// ensure MSB order
for( int i = 0; i < 5; ++i )
diff '--color=auto' -ur kicad-8.0.5.orig/common/kiid.cpp kicad-8.0.5/common/kiid.cpp
--- kicad-8.0.5.orig/common/kiid.cpp 2024-09-06 18:28:40.000000000 +0200
+++ kicad-8.0.5/common/kiid.cpp 2024-11-05 11:40:49.030394379 +0100
@@ -25,9 +25,9 @@
#include <kiid.h>
+#include <boost/random/mersenne_twister.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
-#include <boost/functional/hash.hpp>
#if BOOST_VERSION >= 106700
#include <boost/uuid/entropy_error.hpp>
@@ -235,15 +235,7 @@
size_t KIID::Hash() const
{
- size_t hash = 0;
-
- // Note: this is NOT little-endian/big-endian safe, but as long as it's just used
- // at runtime it won't matter.
-
- for( int i = 0; i < 4; ++i )
- boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
-
- return hash;
+ return boost::uuids::hash_value( m_uuid );
}